7 Replies Latest reply on Apr 12, 2011 10:34 AM by Prasad Deshpande

    Deploying EE5 application on AS7

    Prasad Deshpande Expert

      Is there any change in the way EE5 confirming application to be deployed on AS7? I have a working EE5 ear which gets deployed fine on JBoss 5.0.1, Weblogic 10.3.3 & Glassfish 3.0.1. but it gives error while deploying on AS7.

       

      Is there anything obvious that I could be missing?

        • 1. Deploying EE5 application on AS7
          jaikiran pai Master

          What errors do you get? Please post more details.

          • 2. Re: Deploying EE5 application on AS7
            Prasad Deshpande Expert

            Thanks for Rapid Response Jaikiran,

             

            I've attached logs in the file. Please have a look. It seems to be failing for MessageDriven annotation. Don't know why..

             

            Another question looking at logs, Why is it trying to lookup for file D:/jboss-7.0.0.Beta2/bin/content/efp.ear/lib/iText.jar whereas application is located at D:\jboss-7.0.0.Beta2\standalone\deployments\efp.ear\lib\iText.jar, Assuming that "bin" is temp directory then, it should have all jar files.

             

            application structure is

             

            efp.ear

            +--- lib

            +--- ejb.jar (containing stateless/messagedriven beans only)

            +---- other.war files

            • 3. Re: Deploying EE5 application on AS7
              jaikiran pai Master

              Currently only the following EJB3 features are supported http://community.jboss.org/docs/DOC-16682

              • 4. Deploying EE5 application on AS7
                Prasad Deshpande Expert

                I tried removing MDB's just to see if application gets deployed, I came across couple of things:

                 

                1.  I have packaged my persistence.xml in a separate jar file that resides in "lib" directory of EE5 application. I thought application deployer should have found persistence unit, instead it threw following exception:

                 

                09:15:31,390 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."efp.ear"."ejb.jar".PARSE: org.jboss.msc.service.StartException in servi

                ce jboss.deployment.unit."efp.ear"."ejb.jar".PARSE: Failed to process phase PARSE of subdeployment "ejb.jar" of deployment "efp.ear"

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:108)

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1344)

                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]

                        at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

                Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in subdeployment "ejb.jar" of deployment "efp.ear"

                        at org.jboss.as.jpa.container.PersistenceUnitSearch.resolvePersistenceUnitSupplier(PersistenceUnitSearch.java:52)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getScopedPuName(JPAAnnotationParseProcessor.java:323)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getBindingSource(JPAAnnotationParseProcessor.java:266)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processField(JPAAnnotationParseProcessor.java:184)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getConfiguration(JPAAnnotationParseProcessor.java:147)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.getConfigurations(JPAAnnotationParseProcessor.java:125)

                        at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processComponentConfig(JPAAnnotationParseProcessor.java:93)

                        at org.jboss.as.ee.component.AbstractComponentConfigProcessor.deploy(AbstractComponentConfigProcessor.java:53)

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:102)

                        ... 4 more

                 

                 

                Here is my persistence.xml :

                <?xml version="1.0" encoding="UTF-8"?>

                <persistence xmlns="http://java.sun.com/xml/ns/persistence">

                    <persistence-unit name="efp" transaction-type="JTA">

                        <jta-data-source>java:jdbc/eFpDataSource</jta-data-source>

                        <provider>org.hibernate.ejb.HibernatePersistence</provider>

                        <properties>

                            <property name="hibernate.show_sql" value="false"/>

                            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

                            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                        </properties>

                    </persistence-unit>

                </persistence>

                 

                2. When I moved my persistence.xml to ejb.jar it threw following exception:

                 

                09:29:42,109 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."efp.ear"."ejb.jar".PARSE: org.jboss.msc.service.StartException in servi

                ce jboss.deployment.unit."efp.ear"."ejb.jar".PARSE: Failed to process phase PARSE of subdeployment "ejb.jar" of deployment "efp.ear"

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:108)

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1344)

                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]

                        at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

                Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/D:/jboss-7.0.0.Beta2/bin/content/efp.ear/ejb.jar/META-INF/persistence.xml"

                        at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.parse(PersistenceUnitParseProcessor.java:190)

                        at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.handleJarDeployment(PersistenceUnitParseProcessor.java:99)

                        at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.deploy(PersistenceUnitParseProcessor.java:79)

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:102)

                        ... 4 more

                Caused by: java.lang.NullPointerException

                        at org.jboss.as.jpa.puparser.PersistenceUnitXmlParser.parsePU(PersistenceUnitXmlParser.java:151)

                        at org.jboss.as.jpa.puparser.PersistenceUnitXmlParser.parse(PersistenceUnitXmlParser.java:116)

                        at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.parse(PersistenceUnitParseProcessor.java:186)

                        ... 7 more

                 

                Any thoughts from you?

                • 5. Deploying EE5 application on AS7
                  Scott Marlow Master

                  Prasad,

                   

                  Thank you for reporting these issues, I'll take a look at resolving them.

                   

                  Scott

                  • 6. Deploying EE5 application on AS7
                    Scott Marlow Master

                    Prasad,

                     

                    I started creating a unit test to replicate this problem but was delayed (the in-progress arquillian test case is currently saved on my git stash until I can get back to it).  If you could attach a test case to a jira that reproduces the above issues, I'll use that to debug/improve the JPA deployment code. 

                     

                    Thanks,

                    Scott

                    • 7. Re: Deploying EE5 application on AS7
                      Prasad Deshpande Expert

                      Scott,

                       

                      I've attached sample ear file for your reference. You'll need to create datasource before deploying ear. Another test I'd like you to do is put persistence.xml in efp.ear/lib/interfaces.jar/META-INF & it should be found (currently app server doesn't find persistence.xml if I put in above path).

                       

                      I've created a jira for this https://issues.jboss.org/browse/JBAS-9298.

                       

                      Let me know if you need any help.

                       

                      - Prasad