<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    target/project.war different from project.war that is Run On Server
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/daxxy">Tanya Ruttenberg</a> in <i>JBoss Tools</i> - <a href="https://community.jboss.org/message/727819#727819">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>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... -&gt; Run On Server.&#160; 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....)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.&#160; Building the war file manually using a Run Configuration produces different results than what I get in the my deployed app.&#160; I assume that what gets deployed uses the pom to build the app, is that true?&#160; What actually happens when you do a Run On Server?&#160; Is it supposed to be different than what you do when you do a "mvn clean package"?&#160;&#160; How can I get the result I want in the Run As-&gt;Run On Server version?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here are the two structures.&#160; 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.&#160; In the first (correct - manually generated) build,&#160; persistence.xml is in the correct place. In the 2nd build, it appears twice, and this is messing up the deployment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>d:\Development2\j2ee6\contacts-as7\target&gt;jar -tf contacts-as7.war<br/>META-INF/<br/>META-INF/MANIFEST.MF<br/>icons/<br/>style/<br/>WEB-INF/<br/>WEB-INF/classes/<br/>WEB-INF/classes/gov/<br/>WEB-INF/classes/gov/ssa/<br/>WEB-INF/classes/gov/ssa/dne/<br/>WEB-INF/classes/gov/ssa/dne/nmst/<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/<br/>WEB-INF/lib/<br/>contact.xhtml<br/>favicon.ico<br/>icons/add.png<br/>icons/check.png<br/>icons/delete.png<br/>icons/edit.png<br/>index.html<br/>index.xhtml<br/><span style="color: #ff0000;">META-INF/persistence.xml</span><br/>style/nmst.css<br/>test.xhtml<br/>WEB-INF/beans.xml<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class<br/>WEB-INF/faces-config.xml<br/>WEB-INF/lib/commons-beanutils-1.8.0.jar<br/>WEB-INF/lib/commons-digester-2.0.jar<br/>WEB-INF/lib/commons-lang-2.6.jar<br/>WEB-INF/lib/commons-logging-1.1.1.jar<br/>WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar<br/>WEB-INF/lib/cssparser-0.9.5.jar<br/>WEB-INF/lib/ehcache-1.6.0.jar<br/>WEB-INF/lib/guava-10.0.1.jar<br/>WEB-INF/lib/hibernate-validator-4.2.0.Final.jar<br/>WEB-INF/lib/javax.faces-2.1.5.jar<br/>WEB-INF/lib/joda-time-1.6.jar<br/>WEB-INF/lib/jsr305-1.3.9.jar<br/>WEB-INF/lib/jstl-api-1.2.jar<br/>WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar<br/>WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar<br/>WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar<br/>WEB-INF/lib/prettyfaces-core-3.3.2.jar<br/>WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar<br/>WEB-INF/lib/sac-1.3.jar<br/>WEB-INF/lib/seam-faces-3.1.0.Final.jar<br/>WEB-INF/lib/seam-faces-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-international-3.1.0.Final.jar<br/>WEB-INF/lib/seam-international-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-security-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar<br/>WEB-INF/lib/servlet-api-2.5.jar<br/>WEB-INF/lib/slf4j-api-1.6.1.jar<br/>WEB-INF/lib/solder-api-3.1.0.Final.jar<br/>WEB-INF/lib/solder-impl-3.1.0.Final.jar<br/>WEB-INF/lib/solder-logging-3.1.0.Final.jar<br/>WEB-INF/lib/validation-api-1.0.0.GA.jar<br/>WEB-INF/web.xml<br/>META-INF/maven/<br/>META-INF/maven/gov.ssa.dne.nmst/<br/>META-INF/maven/gov.ssa.dne.nmst/contacts-as7/<br/>META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.xml<br/>META-INF/maven/gov.ssa.dne.nmst/contacts-as7/pom.properties</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>d:\Development2\jboss-eap-6.0.0.Beta1\jboss-eap-6.0\standalone\deployments&gt;jar -tf contacts-as7.jar<br/>contact.xhtml<br/>favicon.ico<br/>icons/<br/>icons/add.png<br/>icons/check.png<br/>icons/delete.png<br/>icons/edit.png<br/>index.html<br/>index.xhtml<br/>META-INF/<br/>META-INF/MANIFEST.MF<br/>META-INF/maven/<br/>META-INF/maven/gov.ssa.dne.nmst/<br/>META-INF/maven/gov.ssa.dne.nmst/<br/>META-INF/maven/gov.ssa.dne.nmst/pom.properties<br/>META-INF/maven/gov.ssa.dne.nmst/pom.xml<br/><span style="color: #ff0000;">META-INF/persistence.xml</span><br/>style/<br/>style/nmst.css<br/>test.xhtml<br/>WEB-INF/<br/>WEB-INF/beans.xml<br/>WEB-INF/classes/<br/>WEB-INF/classes/gov/<br/>WEB-INF/classes/gov/ssa/<br/>WEB-INF/classes/gov/ssa/dne/<br/>WEB-INF/classes/gov/ssa/dne/nmst/<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/ContactService.class<br/>WEB-INF/classes/gov/ssa/dne/nmst/action/ContactView.class<br/>WEB-INF/classes/import.sql<br/>WEB-INF/classes/META-INF/<br/><span style="color: #ff0000;">WEB-INF/classes/META-INF/persistence.xml</span><br/>WEB-INF/faces-config.xml<br/>WEB-INF/lib/<br/>WEB-INF/lib/commons-beanutils-1.8.0.jar<br/>WEB-INF/lib/commons-digester-2.0.jar<br/>WEB-INF/lib/commons-lang-2.6.jar<br/>WEB-INF/lib/commons-logging-1.1.1.jar<br/>WEB-INF/lib/contacts-model-as7-0.0.1-SNAPSHOT.jar<br/>WEB-INF/lib/cssparser-0.9.5.jar<br/>WEB-INF/lib/ehcache-1.6.0.jar<br/>WEB-INF/lib/guava-10.0.1.jar<br/>WEB-INF/lib/hibernate-validator-4.2.0.Final.jar<br/>WEB-INF/lib/javax.faces-2.1.5.jar<br/>WEB-INF/lib/joda-time-1.6.jar<br/>WEB-INF/lib/jsr305-1.3.9.jar<br/>WEB-INF/lib/jstl-api-1.2.jar<br/>WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar<br/>WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar<br/>WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar<br/>WEB-INF/lib/prettyfaces-core-3.3.2.jar<br/>WEB-INF/lib/richfaces-components-api-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-components-ui-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-core-api-4.2.0.Final.jar<br/>WEB-INF/lib/richfaces-core-impl-4.2.0.Final.jar<br/>WEB-INF/lib/sac-1.3.jar<br/>WEB-INF/lib/seam-faces-3.1.0.Final.jar<br/>WEB-INF/lib/seam-faces-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-international-3.1.0.Final.jar<br/>WEB-INF/lib/seam-international-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-persistence-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-security-api-3.1.0.Final.jar<br/>WEB-INF/lib/seam-transaction-api-3.1.0.Final.jar<br/>WEB-INF/lib/servlet-api-2.5.jar<br/>WEB-INF/lib/slf4j-api-1.6.1.jar<br/>WEB-INF/lib/solder-api-3.1.0.Final.jar<br/>WEB-INF/lib/solder-impl-3.1.0.Final.jar<br/>WEB-INF/lib/solder-logging-3.1.0.Final.jar<br/>WEB-INF/lib/validation-api-1.0.0.GA.jar<br/>WEB-INF/web.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is the stack trace I get when the deployment bombs</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>14:22:57,349 INFO&#160; [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "contacts-as7.war"<br/>14:22:58,502 WARN&#160; [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'<br/>14:22:58,502 WARN&#160; [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'<br/>14:22:58,593 INFO&#160; [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb<br/>14:22:58,593 INFO&#160; [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for contactsDb<br/>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"<br/> 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]<br/> 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]<br/> 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]<br/> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]<br/> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]<br/> at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]<br/>Caused by: java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions in application deployment "contacts-as7.war".&#160; Either change the application to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.<br/> at org.jboss.as.jpa.container.PersistenceUnitSearch.resolvePersistenceUnitSupplier(PersistenceUnitSearch.java:69)<br/> at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getPersistenceUnit(JPAAnnotationParseProcessor.java:284)<br/> at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getBindingSource(JPAAnnotationParseProcessor.java:220)<br/> at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processField(JPAAnnotationParseProcessor.java:151)<br/> at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processPersistenceAnnotations(JPAAnnotationParseProcessor.java:118)<br/> at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.deploy(JPAAnnotationParseProcessor.java:90)<br/> 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]<br/> ... 5 more</p><p>14:22:58,633 INFO&#160; [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "contacts-as7.war" was rolled back with failure message {"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"contacts-as7.war\".DEPENDENCIES: Failed to process phase DEPENDENCIES of deployment \"contacts-as7.war\""}}<br/>14:22:58,733 INFO&#160; [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment contacts-as7.war in 95ms<br/>14:22:58,733 INFO&#160; [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report<br/>JBAS014777:&#160;&#160; Services which failed to start:&#160;&#160;&#160;&#160;&#160; 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"</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/727819#727819">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Tools at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>