[jboss-user] [JBoss Tools] - target/project.war different from project.war that is Run On Server

Tanya Ruttenberg do-not-reply at jboss.com
Mon Apr 2 14:24:32 EDT 2012


Tanya Ruttenberg [https://community.jboss.org/people/daxxy] created the discussion

"target/project.war different from project.war that is Run On Server"

To view the discussion, visit: https://community.jboss.org/message/727819#727819

--------------------------------------------------------------
I have gone back and forth between manually building my project using a Run Configuration and simply deploying my app onto the server using Run As... -> Run On Server.  The latter is easier, you don't have to take that first step of building the war file manually and you don't have to mark the target/project.war as Deployable (for some reason the voice in my brain always says "Mark as Deplorable" , but I digress....)

So today I needed to customize the packaging of my app to put persistence.xml into /META-INF rather than in /WEB-INF/classes/META-INF.  Building the war file manually using a Run Configuration produces different results than what I get in the my deployed app.  I assume that what gets deployed uses the pom to build the app, is that true?  What actually happens when you do a Run On Server?  Is it supposed to be different than what you do when you do a "mvn clean package"?   How can I get the result I want in the Run As->Run On Server version?

Here are the two structures.  The first is take from my target subdirectory right after mvn clean package and the second is from the deployments directory, which I reached by right-clicking on the deployed app icon and selecting Explore from the context menu.  In the first (correct - manually generated) build,  persistence.xml is in the correct place. In the 2nd build, it appears twice, and this is messing up the deployment.

d:\Development2\j2ee6\contacts-as7\target>jar -tf contacts-as7.war
META-INF/
META-INF/MANIFEST.MF
icons/
style/
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/gov/
WEB-INF/classes/gov/ssa/
WEB-INF/classes/gov/ssa/dne/
WEB-INF/classes/gov/ssa/dne/nmst/
WEB-INF/classes/gov/ssa/dne/nmst/action/
WEB-INF/lib/
contact.xhtml
favicon.ico
icons/add.png
icons/check.png
icons/delete.png
icons/edit.png
index.html
index.xhtml
META-INF/persistence.xml
style/nmst.css
test.xhtml
WEB-INF/beans.xml
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class
WEB-INF/faces-config.xml
WEB-INF/lib/commons-beanutils-1.8.0.jar
WEB-INF/lib/commons-digester-2.0.jar
WEB-INF/lib/commons-lang-2.6.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar
WEB-INF/lib/cssparser-0.9.5.jar
WEB-INF/lib/ehcache-1.6.0.jar
WEB-INF/lib/guava-10.0.1.jar
WEB-INF/lib/hibernate-validator-4.2.0.Final.jar
WEB-INF/lib/javax.faces-2.1.5.jar
WEB-INF/lib/joda-time-1.6.jar
WEB-INF/lib/jsr305-1.3.9.jar
WEB-INF/lib/jstl-api-1.2.jar
WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
WEB-INF/lib/prettyfaces-core-3.3.2.jar
WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar
WEB-INF/lib/sac-1.3.jar
WEB-INF/lib/seam-faces-3.1.0.Final.jar
WEB-INF/lib/seam-faces-api-3.1.0.Final.jar
WEB-INF/lib/seam-international-3.1.0.Final.jar
WEB-INF/lib/seam-international-api-3.1.0.Final.jar
WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar
WEB-INF/lib/seam-security-api-3.1.0.Final.jar
WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar
WEB-INF/lib/servlet-api-2.5.jar
WEB-INF/lib/slf4j-api-1.6.1.jar
WEB-INF/lib/solder-api-3.1.0.Final.jar
WEB-INF/lib/solder-impl-3.1.0.Final.jar
WEB-INF/lib/solder-logging-3.1.0.Final.jar
WEB-INF/lib/validation-api-1.0.0.GA.jar
WEB-INF/web.xml
META-INF/maven/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.xml
META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.properties


d:\Development2\jboss-eap-6.0.0.Beta1\jboss-eap-6.0\standalone\deployments>jar -tf contacts-as7.jar
contact.xhtml
favicon.ico
icons/
icons/add.png
icons/check.png
icons/delete.png
icons/edit.png
index.html
index.xhtml
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/
META-INF/maven/gov.ssa.dne.nmst/pom.properties
META-INF/maven/gov.ssa.dne.nmst/pom.xml
META-INF/persistence.xml
style/
style/nmst.css
test.xhtml
WEB-INF/
WEB-INF/beans.xml
WEB-INF/classes/
WEB-INF/classes/gov/
WEB-INF/classes/gov/ssa/
WEB-INF/classes/gov/ssa/dne/
WEB-INF/classes/gov/ssa/dne/nmst/
WEB-INF/classes/gov/ssa/dne/nmst/action/
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class
WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class
WEB-INF/classes/import.sql
WEB-INF/classes/META-INF/
WEB-INF/classes/META-INF/persistence.xml
WEB-INF/faces-config.xml
WEB-INF/lib/
WEB-INF/lib/commons-beanutils-1.8.0.jar
WEB-INF/lib/commons-digester-2.0.jar
WEB-INF/lib/commons-lang-2.6.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar
WEB-INF/lib/cssparser-0.9.5.jar
WEB-INF/lib/ehcache-1.6.0.jar
WEB-INF/lib/guava-10.0.1.jar
WEB-INF/lib/hibernate-validator-4.2.0.Final.jar
WEB-INF/lib/javax.faces-2.1.5.jar
WEB-INF/lib/joda-time-1.6.jar
WEB-INF/lib/jsr305-1.3.9.jar
WEB-INF/lib/jstl-api-1.2.jar
WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
WEB-INF/lib/prettyfaces-core-3.3.2.jar
WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar
WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar
WEB-INF/lib/sac-1.3.jar
WEB-INF/lib/seam-faces-3.1.0.Final.jar
WEB-INF/lib/seam-faces-api-3.1.0.Final.jar
WEB-INF/lib/seam-international-3.1.0.Final.jar
WEB-INF/lib/seam-international-api-3.1.0.Final.jar
WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar
WEB-INF/lib/seam-security-api-3.1.0.Final.jar
WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar
WEB-INF/lib/servlet-api-2.5.jar
WEB-INF/lib/slf4j-api-1.6.1.jar
WEB-INF/lib/solder-api-3.1.0.Final.jar
WEB-INF/lib/solder-impl-3.1.0.Final.jar
WEB-INF/lib/solder-logging-3.1.0.Final.jar
WEB-INF/lib/validation-api-1.0.0.GA.jar
WEB-INF/web.xml


This is the stack trace I get when the deployment bombs

14:22:57,349 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "contacts-as7.war"
14:22:58,502 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
14:22:58,502 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
14:22:58,593 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb
14:22:58,593 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb
14:22:58,593 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment "contacts-as7.war"
 at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
 at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
 at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]
 at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
Caused by: java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions in application deployment "contacts-as7.war".  Either change the application to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.
 at org.jboss.as.jpa.container.PersistenceUnitSearch.resolvePersistenceUnitSupplier(PersistenceUnitSearch.java:69)
 at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getPersistenceUnit(JPAAnnotationParseProcessor.java:284)
 at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getBindingSource(JPAAnnotationParseProcessor.java:220)
 at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processField(JPAAnnotationParseProcessor.java:151)
 at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processPersistenceAnnotations(JPAAnnotationParseProcessor.java:118)
 at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.deploy(JPAAnnotationParseProcessor.java:90)
 at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
 ... 5 more
14:22:58,633 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "contacts-as7.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment \"contacts-as7.war\""}}
14:22:58,733 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment contacts-as7.war in 95ms
14:22:58,733 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment "contacts-as7.war"
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/727819#727819]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120402/4039489e/attachment-0001.html 


More information about the jboss-user mailing list