2014-11-11 1 views
8

이것은 EAR 프로젝트의 jboss-deployment-structure.xml입니다.jboss-deployment-structure.xml이 My EAR 프로젝트의 종속성을로드하지 않습니다.

<?xml version="1.0" encoding="UTF-8"?> 

<jboss-deployment-structure > 

<deployment> 

    <dependencies> 
     <module name="org.javassist" export="true" /> 
     <module name="org.apache" export="true"/> 
     <module name="org.antlr" export="true"/> 
     <module name="org.dom4j" export="true"/> 
     <module name="org.apache" export="true"/> 
     <module name="org.hibernate" export="true"/> 

    </dependencies> 

</deployment> 


</jboss-deployment-structure> 

및 EAR 프로젝트에는 배포 경로에있는 다른 프로젝트가 있습니다. 일부는 JARS이고 다른 하나는 WAR입니다. 프로젝트 중 하나는 EAR 프로젝트의 lib에있는 종속성을 사용합니다. 이제 jboss를 lib 폴더에서 제거하고 jboss-deployment-structure.xml 위에 추가했습니다. 항아리가 적재되지 않고 필요한 항아리를 찾지 못하는 실수를 범하는 것 같습니다. 이 최대 절전 모드로 단지가 추가되지 않는 것을 의미 스택 트레이스

08:54:05,555 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SBOS_Online].[resteasy-servlet]] (http--0.0.0.0-8080-1) Servlet.service() for servlet resteasy-servlet threw exception: org.jboss.resteasy.spi.UnhandledException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBusinessImpl' defined in class path resource [config/applicationContext.xml]: Cannot resolve reference to bean 'userHibernateDAOImpl' while setting bean property 'userDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHibernateDAOImpl' defined in class path resource [config/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.scs.sbos.dao.hibernate.impl.UserHibernateDAOImpl]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
The import org.hibernate.Query cannot be resolved 
The import org.hibernate.Session cannot be resolved 
The import org.hibernate.SessionFactory cannot be resolved 
The import org.hibernate.Transaction cannot be resolved 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
Transaction cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
Transaction cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
Transaction cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Query cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Query cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Query cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Session cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
Query cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
SessionFactory cannot be resolved to a type 
SessionFactory cannot be resolved to a type 

at  org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:] 
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:] 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:] 
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:] 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:] 
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:] 
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:] 
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:] 

이지만, 왜 문제를 이잖아.

답변

15

jboss-deployment-structure.xml은 최상위 수준 배포 내에 정의되어야합니다. 즉, WAR 파일을 직접 배포하는 경우 설명자를 포함 할 수 있습니다. WAR를 EAR 파일 내부에 패키징하는 경우, 디스크립터의 내용을 이동하여 EAR 파일의 jboss-deployment-structure.xml 안에 정의해야합니다. 당신은 당신의 jar 파일의 배포 태그에서 MANIFEST.MF 파일로 moudle 종속성을 추가해야합니다 on the JBoss Docs

+0

감사합니다. 예, 나는 그것을 읽었습니다. 하지만 문제는 모든 종속성이 "JAR"인 하나의 프로젝트에서 사용되고 배포 할 때 오류가 발생합니다. 추적 PLZ보세요. 나는 히스가 질문을 편집 –

+0

JAR 종속성을 지정하는 방법으로 버전을 지정할 수 있습니까? –

1

의 좋은 설명이 있습니다

<jboss-deployment-structure> 
    <sub-deployment name="myapp.war"> 
     <dependencies> 
     <module name="org.javassist" export="true" /> 
     <module name="org.apache" export="true"/> 
     <module name="org.antlr" export="true"/> 
     <module name="org.dom4j" export="true"/> 
     <module name="org.apache" export="true"/> 
     <module name="org.hibernate" export="true"/> 
     </dependencies> 
    </sub-deployment> 
</jboss-deployment-structure> 

:

당신은 하위 배포 갈 필요 . 그건 잘 작동합니다.

+0

manifest.mf와 관련된 몇 가지 문제점이 있습니다. 너무 많은 항목이 있으면 빨리 읽기가 어려워집니다. 문자 수는 제한되어 있습니다. – Koekiebox

관련 문제