2016-08-17 1 views
1

다음은 내 받는다는 구성는에 의해 발생 : java.lang.LinkageError : COM/---를 연결하는 데 실패

<modelVersion>4.0.0</modelVersion> 

    <groupId>com.trbrew.commerce.brewtique</groupId> 
    <artifactId>BrewtiqueProject</artifactId> 
    <packaging>pom</packaging> 
    <version>1.0</version> 
    <modules> 
     <module>ejb</module> 
     <module>ear</module> 
     <module>web</module> 
    </modules> 

    <repositories> 
     <repository> 
      <id>maven2-repository.dev.java.net</id> 
      <name>Java.net Repository for Maven</name> 
      <url>http://download.java.net/maven/2/</url> 
      <layout>default</layout> 
     </repository> 
    </repositories> 

    <dependencies> 
    </dependencies> 

입니다 그리고 아이들은

<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.trbrew.commerce</groupId> 
    <artifactId>TrBrewCommerce</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0</version> 
    <name>TrBrewCommerce</name> 
    <url>http://maven.apache.org</url> 

    <dependencies> 


    <dependency> 
     <groupId>com.koinplus</groupId> 
     <artifactId>KoinPlusCommons</artifactId> 
     <version>1.0</version> 
     <scope>system</scope> 
     <systemPath>C://Users/trbrewjars/KoinPlusCommons-1.0.jar</systemPath> 
    </dependency> 

    <dependency> 
     <groupId>com.trbrew.common</groupId> 
     <artifactId>TrBrewCommons</artifactId> 
     <version>1.0</version> 
     <scope>system</scope> 
     <systemPath>C://Users/trbrewjars/TrendBrewCommons-1.0.jar</systemPath> 
    </dependency> 



     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-api</artifactId> 
      <version>7.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.commons</groupId> 
      <artifactId>commons-collections4</artifactId> 
      <version>4.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.7.20</version> 
     </dependency> 

    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 

폼은 귀 모듈의 pom으로

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <parent> 
     <artifactId>BrewtiqueProject</artifactId> 
     <groupId>com.tbrew.commerce.brewtique</groupId> 
     <version>1.0</version> 
    </parent> 
    <modelVersion>4.0.0</modelVersion> 
    <artifactId>Brewtique</artifactId> 
    <packaging>ear</packaging> 
    <dependencies> 
     <dependency> 
      <groupId>com.trbrew.commerce.brewtique</groupId> 
      <artifactId>ejb</artifactId> 
      <version>1.0</version> 
      <type>ejb</type> 
     </dependency> 
     <dependency> 
      <groupId>com.trbrew.commerce.brewtique</groupId> 
      <artifactId>web</artifactId> 
      <version>1.0</version> 
      <type>war</type> 
     </dependency> 
    </dependencies> 
    <build> 
     <plugins> 
      <plugin> 
       <artifactId>maven-ear-plugin</artifactId> 
       <version>2.10.1</version> 
       <configuration> 
        <!--<defaultLibBundleDir>lib</defaultLibBundleDir>--> 
        <modules> 
         <webModule> 
          <groupId>com.trbrew.commerce.brewtique</groupId> 
          <artifactId>web</artifactId> 
         </webModule> 
         <ejbModule> 
          <groupId>com.trbrew.commerce.brewtique</groupId> 
          <artifactId>ejb</artifactId> 
         </ejbModule> 
        </modules> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 


</project> 

ejb 모듈의 크기

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <parent> 
     <artifactId>BrewtiqueProject</artifactId> 
     <groupId>com.trbrew.commerce.brewtique</groupId> 
     <version>1.0</version> 
    </parent> 
    <modelVersion>4.0.0</modelVersion> 

    <artifactId>ejb</artifactId> 
    <packaging>ejb</packaging> 

    <dependencies> 
     <dependency> 
      <groupId>com.trbrew.commerce</groupId> 
      <artifactId>TrBrewCommerce</artifactId> 
      <version>1.0</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-ejb-plugin</artifactId> 
       <version>2.5.1</version> 
       <configuration> 
        <ejbVersion>3.0</ejbVersion> 
        <archive> 
         <manifest> 
          <addClasspath>true</addClasspath> 
         </manifest> 
        </archive> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.5.1</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

내가 생성 된 ear 파일을 실행하는 동안 우연히 오류가

17:31:09,694 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.subunit."Brewtique-1.0.ear"."ejb-1.0.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Brewtique-1.0.ear"."ejb-1.0.jar".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment "ejb-1.0.jar" of deployment "Brewtique-1.0.ear" 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163) 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: java.lang.LinkageError: Failed to link com/trendbrew/commerce/brewtique/catalog/CatalogManagementService (Module "deployment.Brewtique-1.0.ear.ejb-1.0.jar:main" from Service Module Loader) 
     at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437) 
     at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269) 
     at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77) 
     at org.jboss.modules.Module.loadModuleClass(Module.java:560) 
     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) 
     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) 
     at java.lang.Class.forName0(Native Method) 
     at java.lang.Class.forName(Class.java:348) 
     at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) 
     at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:85) 
     at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77) 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156) 
     ... 5 more 
Caused by: java.lang.NoClassDefFoundError: com/koinplus/common/GenericKoinPlusService 
     at java.lang.ClassLoader.defineClass1(Native Method) 
     at java.lang.ClassLoader.defineClass(ClassLoader.java:760) 
     at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353) 
     at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432) 
     ... 19 more 
Caused by: java.lang.ClassNotFoundException: com.koinplus.common.GenericKoinPlusService from [Module "deployment.Brewtique-1.0.ear.ejb-1.0.jar:main" from Service Module Loader] 
     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) 
     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) 
     ... 23 more 

17:31:09,725 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0003: Processing weld deployment web-1.0.war 
17:31:09,804 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "Brewtique-1.0.ear")]) - failure description: { 
    "WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"Brewtique-1.0.ear\".\"ejb-1.0.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"Brewtique-1.0.ear\".\"ejb-1.0.jar\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"ejb-1.0.jar\" of deployment \"Brewtique-1.0.ear\" 
    Caused by: java.lang.LinkageError: Failed to link com/trendbrew/commerce/brewtique/catalog/CatalogManagementService (Module \"deployment.Brewtique-1.0.ear.ejb-1.0.jar:main\" from Service Module Loader) 
    Caused by: java.lang.NoClassDefFoundError: com/koinplus/common/GenericKoinPlusService 
    Caused by: java.lang.ClassNotFoundException: com.koinplus.common.GenericKoinPlusService from [Module \"deployment.Brewtique-1.0.ear.ejb-1.0.jar:main\" from Service Module Loader]"}, 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [ 
     "jboss.deployment.unit.\"Brewtique-1.0.ear\".batch.environment is missing [jboss.deployment.unit.\"Brewtique-1.0.ear\".beanmanager]", 
     "jboss.deployment.unit.\"Brewtique-1.0.ear\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"Brewtique-1.0.ear\".beanmanager]", 
     "jboss.deployment.subunit.\"Brewtique-1.0.ear\".\"web-1.0.war\".batch.environment is missing [jboss.deployment.subunit.\"Brewtique-1.0.ear\".\"web-1.0.war\".beanmanager]", 
     "jboss.persistenceunit.\"Brewtique-1.0.ear/ejb-1.0.jar#tbCommPersistence\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasource.wishinity]", 

EAR 파일 제이보스에 배포하고 그 이유를 크랙 할 수없는

입니다. 모든 단서?

재시도 ... 리 패키징, 운이 좋으면 새로 고침/새로 고침. 여기

+0

당신은 GenericKoinPlusService를 사용하여 EAR 프로젝트의 어린이의 pom.xml을 보여줄 수 있습니까? – davidxxx

+0

@ davidhxxx 응답 해 주셔서 감사합니다. 요청 된 폼을 추가하십시오. –

+0

나는 또한이 모듈의 pom을 필요로한다 : :) – davidxxx

답변

2

는 :

<dependency> 
    <groupId>com.koinplus</groupId> 
    <artifactId>KoinPlusCommons</artifactId> 
    <version>1.0</version> 
    <scope>system</scope> 
    <systemPath>C://Users/trbrewjars/KoinPlusCommons-1.0.jar</systemPath> 
</dependency> 

<dependency> 
    <groupId>com.trbrew.common</groupId> 
    <artifactId>TrBrewCommons</artifactId> 
    <version>1.0</version> 
    <scope>system</scope> 
    <systemPath>C://Users/trbrewjars/TrendBrewCommons-1.0.jar</systemPath> 
</dependency> 

당신은 system 범위와 종속성을 선언합니다.
TrBrewCommerce 이슈의 해상도와 최종 EAR 이슈에서 이러한 종속성을 가질 수 없습니다.
이러한 병이 EAR에 포함되도록하려면 system 범위를 유지하기 위해 트릭을 사용하여 깨끗한 빌드가되지 않습니다.
더 깨끗한 방법은이 두 jar를 Maven 저장소에 설치하는 것입니다. 당신이 범위 system 제거 할 수 있습니다, 후 (이 경우, 범위 runtime이 기본적으로 사용됩니다)와 같은 의존성 선언에서 시스템 경로 :

<dependency> 
    <groupId>com.koinplus</groupId> 
    <artifactId>KoinPlusCommons</artifactId> 
    <version>1.0</version> 
</dependency> 

<dependency> 
    <groupId>com.trbrew.common</groupId> 
    <artifactId>TrBrewCommons</artifactId> 
    <version>1.0</version> 
</dependency> 

는 메이븐 이슈를 설치하려면 install-file이 목표 :

https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

+0

고마워요. 메이븐은 항상 나에게 악몽이다. –

+0

그것은 즐거움이다. 당신이 전통적인 일을하지 않을 때, 메이븐은 실제로 악몽이 될지 모른다. 그래서 '시스템 범위'가 종종 트릭이기 때문에 트릭을 기반으로 한 솔루션보다 Maven을 우호적으로 유지할 수있는 솔루션을 의도적으로 제공 한 것입니다 .-) – davidxxx