2017-02-22 275 views
0

Plese幫助我在Wildfly中設置依賴關係。 我有Maven項目 家長:WildFly依賴關係

  • 服務
  • 網絡

服務是EJB。網絡是web.war中

<jboss-deployment-structure> 
    <!--<ear-subdeployments-isolated>false</ear-subdeployments-isolated>--> 
    <deployment name="mobile-console.war"> 
     <dependencies> 
      <module name="by.lib" meta-inf="export" export="true"/> 
      <module name="deployment.services-1.0.5.ear.model-core-1.1.jar"/> 
      <module name="deployment.services-1.0.5.ear.by.utils-1.0.2.jar"/> 
     </dependencies> 
    </deployment> 
</jboss-deployment-structure> 
使用utils.jar從Service.ear

Service.ejb Utils.jar在LIB

<build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-ear-plugin</artifactId> 
       <version>${maven-ear-plugin.version}</version> 
       <configuration> 
        <earName>${project.build.finalName}</earName> 
        <modules> 
... 
         <javaModule> 
          <groupId>by.services</groupId> 
          <artifactId>by.utils</artifactId> 
          <bundleDir>lib</bundleDir> 
         </javaModule> 
... 

JBoss的部署,strucuture.xml WAR

所以我有錯誤

11:58:25,987 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "web.war")]) - failure description: { 
    "WFLYCTL0412: Required services that are not installed:" => [ 
     "module.resolved.service.\"deployment.web.war\".main", 
     "jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main" 
    ], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [ 
     "jboss.module.service.\"deployment.web.war\".main is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main, module.resolved.service.\"deployment.web.war\".main]", 
     "jboss.module.resolve.phase.\"deployment.web.war\".main.1 is missing [jboss.module.spec.service.\"deployment.mobile.bank.services-1.0.5.ear.by.utils-1.0.2.jar\".main]" 
    ] 
} 
11:58:25,988 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "web.war" was rolled back with the following failure message: 
{ 
    "WFLYCTL0412: Required services that are not installed:" => [ 
     "module.resolved.service.\"deployment.web.war\".main", 
     "jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main" 
    ], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [ 
     "jboss.module.service.\"deployment.web.war\".main is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main, module.resolved.service.\"deployment.web.war\".main]", 
     "jboss.module.resolve.phase.\"deployment.web.war\".main.1 is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main]" 
    ] 
} 
11:58:26,001 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment web.war (runtime-name: web.war) in 12ms 
11:58:26,002 INFO [org.jboss.as.controller] (management-handler-thread - 1) WFLYCTL0183: Service status report 
WFLYCTL0184: New missing/unsatisfied dependencies: 
     service jboss.module.service."deployment.web.war".main (missing) dependents: [service jboss.deployment.unit."web.war".FIRST_MODULE_USE] 
     service jboss.module.spec.service."deployment.web.war".main (missing) dependents: [service jboss.module.service."deployment.web.war".main] 
     service jboss.module.spec.service."deployment.services-1.0.5.ear.by.utils-1.0.2.jar".main (missing) dependents: [service jboss.module.service."deployment.web.war".main, service jboss.module.resolve.phase."deployment.web.war".main.1] 
     service module.resolved.service."deployment.web.war".main (missing) dependents: [service jboss.module.service."deployment.web.war".main] 

我該怎麼做做錯了?

+1

爲什麼你認爲你需要'jboss-deployment-strucuture.xml'文件?你使用的是什麼版本的WildFly? –

+0

Wildfly 10.1.0 jboss-deployment-strucuture.xml - 我的猜測 – LeshaRB

回答

1

您不需要構建EAR文件。

你大概已經有

<dependency> 
    <groupId>by.services</groupId> 
    <artifactId>by.utils</artifactId> 
    <version>...</version> 
</dependency> 

,並在pom.xml爲Web應用程序的EJB依賴。

即使您正在使用EJB,也只是構建並部署生成的WAR文件,即。兩個相關的jar應該在WAR文件的WEB-INF/lib目錄中完成。

您不需要任何特殊的部署描述符,也不需要知道EAR文件中模塊的類可見性規則。

+0

是的,我擁有它但是提供了作用域 – LeshaRB

+0

從這兩個依賴關係中刪除'提供的' –

+0

那麼,爲什麼我要在EAR中放置Utils.jar和WAR?爲什麼不能退出EAR? – LeshaRB