13 Replies Latest reply on May 5, 2015 3:10 AM by mhlulani

    Why the ear file can not deploy under AS 7.0?

    adrianzuo

      All

       

      I have an ear file names migrate.ear which contains one ejb jar (ejb.jar) and one war file (war.war), if I put the ejb jar to a ejb folder and war file to war folder, the ear can not be depoyed.

      If I move the ejb jar to war file out, it can be deployed. Why? Is it the new structuer in the AS 7.0?

       

      Below  structuer can be deployed:

      ejb.jar

      lib/

      lib/util-1.0-SNAPSHOT.jar

      lib/version.jar

      META-INF/

      META-INF/application.xml

      META-INF/MANIFEST.MF

      war.war

       

       

      Below structure can not be deployed:

      ejb/

      ejb/ejb.jar

      lib/

      lib/util-1.0-SNAPSHOT.jar

      lib/version.jar

      META-INF/

      META-INF/application.xml

      META-INF/MANIFEST.MF

      war/

      war/war.war

        • 1. Re: Why the ear file can not deploy under AS 7.0?
          beve

          What does your application.xml file look like? Does it reflect that the ejb and the war are no longer in the root of the ear?

           

          Regards,

           

          /Daniel

          • 2. Re: Why the ear file can not deploy under AS 7.0?
            adrianzuo

            Hi Daniel

             

            I also change the contnent of the application.xml according to the ear structure.

             

            Below content of the application.xml can be deployed:

            <?xml version="1.0"?>

            <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">

                <application-name>migrate</application-name>

                <display-name>Migrate App 6</display-name>

                <module>

                    <web>

                        <web-uri>war.war</web-uri>

                        <context-root>war</context-root>

                    </web>

                </module>

                <module>

                    <ejb>ejb.jar</ejb>

                </module>

                <library-directory>lib</library-directory>

            </application>

             

            Below content can not be deployed:

            <?xml version="1.0"?>

            <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">

                <application-name>migrate</application-name>

                <display-name>Migrate App 6</display-name>

                <module>

                    <web>

                        <web-uri>war/war.war</web-uri>

                        <context-root>war</context-root>

                    </web>

                </module>

                <module>

                    <ejb>ejb/ejb.jar</ejb>

                </module>

                <library-directory>lib</library-directory>

            </application>

            • 3. Re: Why the ear file can not deploy under AS 7.0?
              beve

              I also change the content of the application.xml according to the ear structure.

               

              Great. I just tried the this and I'm getting the same error I think. This is the error I'm getting:

               

              09:25:26,664 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "migrate.ear"
              09:25:26,730 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "wardir/war.war"
              09:25:26,731 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "ejbdir/ejb.jar"
              
              
              09:25:26,935 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "migrate.ear" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"migrate.ear\".PARSE missing [ jboss.deployment.subunit.\"migrate.ear\".\"ejbdir/ejb.jar\".STRUCTURE, jboss.deployment.subunit.\"migrate.ear\".\"wardir/war.war\".STRUCTURE ]"]}
              09:25:26,940 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment wardir/war.war in 3ms
              09:25:26,940 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment ejbdir/ejb.jar in 4ms
              09:25:26,943 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment migrate.ear in 8ms
              09:25:26,944 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"migrate.ear\".PARSE missing [ jboss.deployment.subunit.\"migrate.ear\".\"ejbdir/ejb.jar\".STRUCTURE, jboss.deployment.subunit.\"migrate.ear\".\"wardir/war.war\".STRUCTURE ]"]}}}
              
              

              I named my subdirectories differently but I also tried using the directory names you used.

              I'll take a look and see if I can figure out what is going on here.

               

              Regards,

               

              /Daniel

              • 4. Re: Why the ear file can not deploy under AS 7.0?
                adrianzuo

                Daniel

                 

                Thanks for your response, your error is same with mine.

                If you have any result, please let me know.

                 

                Regards,

                • 5. Re: Why the ear file can not deploy under AS 7.0?
                  beve

                  Can you try modifying your application.xml to something like this:

                   

                  <module>
                      <web>
                           <web-uri>wardir.war.war</web-uri>
                           <context-root>war</context-root>
                       </web>
                   </module>
                   <module>
                       <ejb>ejbdir.ejb.jar</ejb>
                   </module>
                  
                  

                  I'm not sure if this is the way it is supposed to work but with this the ear deploys without error.

                   

                  Regards,

                   

                  /Daniel

                  • 6. Re: Why the ear file can not deploy under AS 7.0?
                    adrianzuo

                    Hi Daniel

                     

                    I tried your way, but I met below errors:

                     

                    17:17:18,919 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."migrate.ear".ST

                    RUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."migrate.ear".STRUCTURE: Failed to process phase STRUCTURE of depl

                    oyment "migrate.ear"

                            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:

                    7.0.2.Final]

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

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

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

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

                    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Unable to process modules in application.xml for EAR ["/D:/yoda/expo

                    rt/home/jboss/bin/content/migrate.ear"], module file wardir.war.war not found

                            at org.jboss.as.ee.structure.EarStructureProcessor.deploy(EarStructureProcessor.java:174)

                            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:

                    7.0.2.Final]

                            ... 5 more

                    And the output of the "jar -tf migrate.ear" is as below:

                    ejb/

                    ejb/ejb.jar

                    lib/

                    lib/util-1.0-SNAPSHOT.jar

                    lib/version.jar

                    META-INF/

                    META-INF/application.xml

                    META-INF/MANIFEST.MF

                    war/

                    war/war.war

                     

                    And I tried rename the "ejb" folder to "ejbdir" and "war" folder to "wardir", but it seems no work, the error still exist.

                     

                    Regards,

                    • 7. Re: Why the ear file can not deploy under AS 7.0?
                      beve

                      I must have deployed a version without the subdirectories without noticing:( Please ignore my last post and sorry for the confusion.

                       

                      Regards,

                       

                      /Daniel

                      • 8. Re: Why the ear file can not deploy under AS 7.0?
                        adrianzuo

                        Daniel

                         

                        Any update on this issue?

                         

                         

                        Regards.

                        • 9. Re: Why the ear file can not deploy under AS 7.0?
                          beve

                          I've just tried this again with the latest build and I'm still getting the same error that you originally reported.

                          Could you create a jira for this so that it can be tracked and please attatch your example.

                           

                          Thanks,

                           

                          /Daniel

                          • 10. Re: Why the ear file can not deploy under AS 7.0?
                            jaikiran

                            Was there a JIRA created for this? This surely looks like a bug.

                            • 11. Re: Why the ear file can not deploy under AS 7.0?
                              adrianzuo

                              Daniel

                               

                              Done. See https://issues.jboss.org/browse/AS7-2067

                               

                              Regards,

                              Candice

                              • 12. Re: Why the ear file can not deploy under AS 7.0?
                                adrianzuo

                                Done. See https://issues.jboss.org/browse/AS7-2067

                                 

                                Regards,

                                Candice

                                • 13. Re: Why the ear file can not deploy under AS 7.0?
                                  mhlulani

                                  According to the EJB 3.1 Specification the following is correct:

                                  ejb.jar

                                  lib/

                                  lib/util-1.0-SNAPSHOT.jar

                                  lib/version.jar

                                  META-INF/

                                  META-INF/application.xml

                                  META-INF/MANIFEST.MF

                                  war.war

                                  JSR-000318 Enterprise JavaBeans 3.1 Final Release Specification for Evaluation 3.1 Eval

                                   

                                  One thing to note is that some application servers are more lenient, but the above is the correct way to package you archive.