7 Replies Latest reply on Apr 6, 2011 3:21 PM by jaikiran pai

    Migrating from JBoss AS 4.2.1 to 5.1.0

    Michael Huang Newbie

      I am migrating from 4.2.1 from 5.1.0. The ear file works fine with 4.2.1, after changing xml descriptor files to new xsd and migrating to 5.1.0, still got the follwoing issue. Seems to to a application.xml issue. But I checked application.xml, there seems to be no issue with it. Could anyone point me to the right direction? Many thanks.

       

      15:52:10,405 INFO  [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl@5b78cf[ defaultDomain='jboss' ]

      15:52:11,061 ERROR [ProfileDeployAction] Failed to add deployment: acesEar.ear

      org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(acesEar.ear)

      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

      at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:85)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1004)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:440)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:390)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:300)

      at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.addDeployment(MainDeployerAdapter.java:86)

      at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:61)

      at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

      at org.jboss.Main.boot(Main.java:221)

      at org.jboss.Main$1.run(Main.java:556)

      at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.RuntimeException: Error determining structure: acesEar.ear

      at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:293)

      at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73)

      at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:196)

      at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:221)

      at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)

      ... 21 more

      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: {http://java.sun.com/xml/ns/javaee}application not found as a child of {http://java.sun.com/xml/ns/javaee}application in unordered_sequence: {http://java.sun.com/xml/ns/javaee}module* {http://java.sun.com/xml/ns/javaee}security-role* {http://java.sun.com/xml/ns/javaee}library-directory? {all {http://java.sun.com/xml/ns/javaee}descriptionGroup}?

      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)

      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:183)

      at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:161)

      at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:160)

      ... 25 more

      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {http://java.sun.com/xml/ns/javaee}application not found as a child of {http://java.sun.com/xml/ns/javaee}application in unordered_sequence: {http://java.sun.com/xml/ns/javaee}module* {http://java.sun.com/xml/ns/javaee}security-role* {http://java.sun.com/xml/ns/javaee}library-directory? {all {http://java.sun.com/xml/ns/javaee}descriptionGroup}?

      at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:383)

      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)

      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

      at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)

      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)

      ... 28 more

       

       

      ===========application.xml below=============

      <?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" version="5"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/application_5.xsd">
      <application>
          <display-name>xxxEar</display-name>

          <module>
              <java>common.jar</java>
          </module>
          <module>
              <java>commonLib.jar</java>
          </module>
      ............

          <module>
              <web>
                  <web-uri>xxxWebApp.war</web-uri>
                  <context-root>/</context-root>
              </web>
          </module>

      ..........................
          <security-role>
              <description>XXXXX</description>
              <role-name>XXXX</role-name>
          </security-role>

      </application>

        • 1. Re: Migrating from JBoss AS 4.2.1 to 5.1.0
          jaikiran pai Master

          Michael Huang wrote:

           


          <?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" version="5"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/application_5.xsd">
          <application>

          The file has a problem. Notice the "application" element starting twice? Change it to:

           

           

           

          <?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" version="5"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/application_5.xsd">
          
          • 2. Migrating from JBoss AS 4.2.1 to 5.1.0
            Michael Huang Newbie

            Hi Jaikian,

             

            Thank you so much. I simply removed the <application> tag, and the problem was solved.

             

            However, I got the follwoing ApplicationException error for the ear file, though the ear file worked fine with the 4.2.1 AS.

             

            IllegalArgumentException: ApplicationException is only valid on an Exception

             

            I searched the web, it seems indicating an issue with  @ApplicationException annotation.  The annoation should be used with an Exception rather than a xxxSessionEJB class (if this is the case, I don't understand why it worked with 4.2.1).

             

            Here is the way the annotation was used in the 4.2.1 code, would you be able to spot anything wrong or direct me to the right direction?

             

            Thank you in advance for your help.

             

            Michael

             

            =============================

            @ApplicationException(rollback = true)
            public class ReportedEquipmentSessionEJB extends AcesSessionStatelessEJB
                    implements ReportedEquipmentDelegate {

                /**
                 * Default Constructor.
                 */
                public ReportedEquipmentSessionEJB() {
                }

            .......

            }

             

            • 3. Migrating from JBoss AS 4.2.1 to 5.1.0
              jaikiran pai Master

              @ApplicationException(rollback = true)

              public class ReportedEquipmentSessionEJB

              Like the error message says, you can't have the @ApplicationException on the bean class. Instead it has to be on the exception class which you expect to be an application exception. Do you have any such exceptions? If not, just remove that annotation from the bean.

              • 4. Migrating from JBoss AS 4.2.1 to 5.1.0
                Michael Huang Newbie

                After removing @ApplicationException from all existing SessionEJBs, and put the @ApplicationException in BusinessException (a sub of Exception) and SystemException (a sub of RuntimeException), the EAR loaded successfully in 5.1.0.  Hope this info will help others who are doing migrating, too.

                 

                One thing is worth mentioning: the 4.2 allowed the @ApplicationException on SessionEJB, without complaining. It was not sure whether 4.2 just ignored the annoation, or it allows this as a variation of the systax. Further, with @ApplicationException on Exception,  5.1.0 loads the EAR successfully, but is there any independent test to verify that it will behave as it's supposed to? Let me know if you know the resutls or plan to do some test. Thanks.

                • 5. Migrating from JBoss AS 4.2.1 to 5.1.0
                  jaikiran pai Master

                  Michael Huang wrote:

                   

                    One thing is worth mentioning: the 4.2 allowed the @ApplicationException on SessionEJB, without complaining. It was not sure whether 4.2 just ignored the annoation, or it allows this as a variation of the systax.

                  JBoss AS 4.2.x was not fully EJB3 spec compliant. So it was a bug.

                   

                   

                  Michael Huang wrote:

                   

                  Further, with @ApplicationException on Exception,  5.1.0 loads the EAR successfully, but is there any independent test to verify that it will behave as it's supposed to? Let me know if you know the resutls or plan to do some test. Thanks.

                  The spec mandates that the @ApplicationException be applied to an exception class and not the bean class. So it's the expected behaviour.

                  • 6. Migrating from JBoss AS 4.2.1 to 5.1.0
                    Michael Huang Newbie

                    I think I probably should rephrase my questions:

                    1)  Does 4.2 just ignore the annoation, or  allow this as a variation of the syntax.; and

                    2) For 5.10, with @ApplicationException (rollback=true), will the server direct the exception from SessionEJB to its client and rollback the transaction?

                     

                    Thanks

                    • 7. Migrating from JBoss AS 4.2.1 to 5.1.0
                      jaikiran pai Master

                      Michael Huang wrote:

                       

                      I think I probably should rephrase my questions:

                      1)  Does 4.2 just ignore the annoation, or  allow this as a variation of the syntax.;

                      I don't know what it does in 4.2. But whatever it does is a bug because @ApplicationException clearly isn't allowed on the bean class.

                       

                       

                      Michael Huang wrote:

                       

                       

                      2) For 5.10, with @ApplicationException (rollback=true), will the server direct the exception from SessionEJB to its client and rollback the transaction?

                       

                      Yes

                      1 of 1 people found this helpful