Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
696 views
in Technique[技术] by (71.8m points)

maven - Cannot deploy ear on WildFly 8 due to failures when processing its structure

I'm having the following error on Wildfly when trying to deploy an EAR that currently works on Glassfish 4:

09:04:08,976 ERROR [org.jboss.as.controller.management-operation] 
(DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment")
 failed - address: ([]) - failure description: {"JBAS014671: Failed services" => 
{"jboss.deployment.unit."planoa.ear".STRUCTURE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit."planoa.ear".STRUCTURE: JBAS018733: Failed to process phase
STRUCTURE of deployment "planoa.ear"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
JBAS011037: Unable to process modules in application.xml for EAR 
["/home/psoto/Programs/wildfly-8.1.0.Final/standalone/deployments/planoa.ear"],
module file planoa-update-ejb.jar not found"}}

09:04:09,071 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018565:
Replaced deployment "planoa.ear" with deployment "planoa.ear"
09:04:09,072 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) 
JBAS014774: Service status report
JBAS014777:   Services which failed to start:
service jboss.deployment.unit."planoa.ear".STRUCTURE:
org.jboss.msc.service.StartException in service 
jboss.deployment.unit."planoa.ear".STRUCTURE: JBAS018733: Failed to process phase 
STRUCTURE of deployment "planoa.ear" 
service jboss.deployment.unit."planoa.ear".STRUCTURE

This is the content of my application.xml (generated with maven ear plugin):

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
  <display-name>planoa-ear</display-name>
  <module>
    <ejb>planoa-update-ejb.jar</ejb>
  </module>
  <module>
    <ejb>planoa-core-ejb.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>planoa-web.war</web-uri>
      <context-root>/</context-root>
    </web>
  </module>
  <library-directory>lib</library-directory>
</application>

This is the output of jar -tf myearfile.ear:

META-INF/
META-INF/MANIFEST.MF
lib/
lib/planoa-messages.jar/
lib/planoa-messages.jar/META-INF/
lib/planoa-messages.jar/META-INF/maven/
lib/planoa-messages.jar/META-INF/maven/com.gi.planoa/
lib/planoa-messages.jar/META-INF/maven/com.gi.planoa/planoa-messages/
lib/planoa-pu.jar/
lib/planoa-pu.jar/com/
lib/planoa-pu.jar/com/gi/
lib/planoa-pu.jar/com/gi/planoa/
lib/planoa-pu.jar/com/gi/planoa/pu/
lib/planoa-pu.jar/com/gi/planoa/pu/eclipselink/
lib/planoa-pu.jar/com/gi/planoa/pu/eclipselink/logger/
lib/planoa-pu.jar/META-INF/
lib/planoa-pu.jar/META-INF/maven/
lib/planoa-pu.jar/META-INF/maven/com.gi.planoa/
lib/planoa-pu.jar/META-INF/maven/com.gi.planoa/planoa-pu/
lib/planoa-log.jar/
lib/planoa-log.jar/META-INF/
lib/planoa-log.jar/META-INF/maven/
lib/planoa-log.jar/META-INF/maven/com.gi.planoa/
lib/planoa-log.jar/META-INF/maven/com.gi.planoa/planoa-log/
planoa-web.war
META-INF/application.xml
META-INF/jboss-app.xml
META-INF/glassfish-application.xml
META-INF/jboss-deployment-structure.xml
planoa-core-ejb.jar
planoa-update-ejb.jar
lib/commons-codec-1.5.jar
lib/gson-2.2.4.jar
lib/gi-commons-ejb-jee7-3.0.37.jar
lib/gi-commons-logback-3.0.37.jar
lib/gi-commons-jsf2-3.0.37.jar
lib/poi-3.10-FINAL.jar
lib/planoa-core-service.jar
lib/commons-lang3-3.1.jar
lib/gi-commons-utils-3.0.37.jar
lib/gi-commons-jaxws-3.0.37.jar
lib/planoa-messages.jar/WebMessageResources.properties
lib/planoa-messages.jar/META-INF/MANIFEST.MF
lib/planoa-messages.jar/META-INF/maven/com.gi.planoa/planoa-messages/pom.properties
lib/planoa-messages.jar/META-INF/maven/com.gi.planoa/planoa-messages/pom.xml
lib/planoa-messages.jar/ValidationMessages.properties
lib/providers-io-geonames-1.0.03-20141008.234431-86.jar
lib/joda-time-2.4.jar
lib/planoa-pu.jar/com/gi/planoa/pu/eclipselink/logger/PlanoASqlSessionLog.class
lib/planoa-pu.jar/com/gi/planoa/pu/eclipselink/logger/PlanoASqlSessionCustomizer.class
lib/planoa-pu.jar/META-INF/MANIFEST.MF
lib/planoa-pu.jar/META-INF/persistence.xml
lib/planoa-pu.jar/META-INF/maven/com.gi.planoa/planoa-pu/pom.properties
lib/planoa-pu.jar/META-INF/maven/com.gi.planoa/planoa-pu/pom.xml
lib/slf4j-api-1.7.7.jar
lib/logback-core-1.1.2.jar
lib/commons-logging-1.1.3.jar
lib/primefaces-5.0.6.jar
lib/planoa-log.jar/logback_desarrollo.xml
lib/planoa-log.jar/META-INF/MANIFEST.MF
lib/planoa-log.jar/META-INF/maven/com.gi.planoa/planoa-log/pom.properties
lib/planoa-log.jar/META-INF/maven/com.gi.planoa/planoa-log/pom.xml
lib/planoa-log.jar/logback.xml
lib/gi-commons-beanvalidation-3.0.37.jar
lib/commons-lang-2.6.jar
lib/gi-commons-validation-3.0.37.jar
lib/logback-classic-1.1.2.jar
lib/planoa-core-model.jar
lib/primefaces-extensions-2.1.0.jar
META-INF/maven/
META-INF/maven/com.gi.planoa/
META-INF/maven/com.gi.planoa/planoa-ear/
META-INF/maven/com.gi.planoa/planoa-ear/pom.xml
META-INF/maven/com.gi.planoa/planoa-ear/pom.properties

The error says that planoa-update-ejb.jar was not found, but as you can see, its inside the ear.

Moreover, if I pick the generated ear, and deploy it through the web interface it works perfectly. So I think its a problem with netbeans wildfly plugin.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After hours of searching I think I found what the issue is. Its important to understand that the EE 7 plugins for Netbeans seem to deploy the EARs and WARs as exploded artifacts (This makes development fast). The reason why the packaged EAR will work and the exploded ear doesn't is in fact exactly what its telling you (it cannot find the module(s)).

You have to look your application server's deployment directory.

NOTE: running jar -tf on you packaged EAR will give you misleading information, because that's NOT what's deployed when using an IDE to deploy

The root cause of this issue is in the way you build your project. I know in Maven some of us like the do away with version information by doing something like this:

<build>
   <!-- This is replicated to your packing mechanisms (May cause problems in Exploded deployments) -->
   <finalName>${project.artifactId}</finalName>
</build>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...