8 Replies Latest reply on Feb 11, 2009 8:29 AM by jaikiran

    Error when deploying EAR file

      Hi All,

      Anybody can help me out to resolve the below error....?

      Thanks in advance.


      Error
      =====


      11:29:35,901 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/D:/jboss-5.0.0
      .GA/server/default/deploy/booking.ear state=Not Installed mode=Manual requiredState=Parse
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/D:/jboss-5.0.
      0.GA/server/default/deploy/booking.ear/BookingENEJB.jar
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentExcept
      ion.java:49)
      at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData
      (AbstractParsingDeployerWithOutput.java:337)
      at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData
      (AbstractParsingDeployerWithOutput.java:297)
      at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData
      (AbstractParsingDeployerWithOutput.java:269)
      at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(Abstrac
      tParsingDeployerWithOutput.java:230)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.ja
      va:1157)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.ja
      va:1210)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.
      java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:93
      4)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1
      062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:9
      84)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
      ThreadPoolExecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
      dThreadPoolExecutor.java:181)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
      oolExecutor.java:205)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: cvc-complex-type.2.4.a: In
      valid content was found starting with element 'cmp-field'. One of '{"http://java.sun.com/xml/ns/j2ee
      ":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-
      ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref,
      "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destin
      ation-ref, "http://java.sun.com/xml/ns/j2ee":security-role-ref, "http://java.sun.com/xml/ns/j2ee":se
      curity-identity, "http://java.sun.com/xml/ns/j2ee":query}' is expected. @ vfszip:/D:/jboss-5.0.0.GA/
      server/default/deploy/booking.ear/BookingENEJB.jar/META-INF/ejb-jar.xml[2524,24]
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
      at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
      at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.ja
      va:199)
      at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.ja
      va:170)
      at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.
      java:132)
      at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.
      java:118)
      at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSP
      arsingDeployer.java:256)
      at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingD
      eployer.java:188)
      at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData
      (AbstractParsingDeployerWithOutput.java:323)
      ... 28 more
      Caused by: org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with
      element 'cmp-field'. One of '{"http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml
      /ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee
      ":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":res
      ource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/n
      s/j2ee":security-role-ref, "http://java.sun.com/xml/ns/j2ee":security-identity, "http://java.sun.com
      /xml/ns/j2ee":query}' is expected. @ vfszip:/D:/jboss-5.0.0.GA/server/default/deploy/booking.ear/Boo
      kingENEJB.jar/META-INF/ejb-jar.xml[2524,24]
      at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBPar
      ser.java:426)
      at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)

      at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.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)
      ... 36 more
      11:29:36,026 WARN [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE
      PREVIOUS ERRORS FOR DETAILS):

      *** CONTEXTS IN ERROR: Name -> Error

      vfszip:/D:/jboss-5.0.0.GA/server/default/deploy/booking.ear -> org.xml.sax.SAXException: cvc-complex
      -type.2.4.a: Invalid content was found starting with element 'cmp-field'. One of '{"http://java.sun.
      com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j
      2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee"
      :resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee"
      :message-destination-ref, "http://java.sun.com/xml/ns/j2ee":security-role-ref, "http://java.sun.com/
      xml/ns/j2ee":security-identity, "http://java.sun.com/xml/ns/j2ee":query}' is expected. @ vfszip:/D:/
      jboss-5.0.0.GA/server/default/deploy/booking.ear/BookingENEJB.jar/META-INF/ejb-jar.xml[2524,24]


      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)

      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:665
      )
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
      at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
      ThreadPoolExecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
      dThreadPoolExecutor.java:181)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
      oolExecutor.java:205)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

        • 1. Re: Error when deploying EAR file
          jaikiran

          As per the logs your ejb-jar.xml (D:/jboss-5.0.0.GA/server/default/deploy/booking.ear/BookingENEJB.jar/META-INF/ejb-jar.xml) is not well formed. Specifically because of this:

          Invalid content was found starting with element 'cmp-field'.


          While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

          • 2. Re: Error when deploying EAR file

            Hi Jaikiran,

            I am very new to this forum. Will corect. Thanks for your suggestion.

            My problem is here, The same EAR file has been deployed and running successfully in the JBoss 4.2.3 App server. But the above exception is thorwing only when i deploying in JBoss 5.0.0 App server. What is the problem and where i did mistake ..? )(or) do i need to have any library jar files in my lib folders..?. Kindly advise me how to resolve.

            Thanks and Regards,
            Ganapathi sundaram.G

            • 3. Re: Error when deploying EAR file
              jaikiran

               

              "ganapathysundarum" wrote:
              The same EAR file has been deployed and running successfully in the JBoss 4.2.3 App server. But the above exception is thorwing only when i deploying in JBoss 5.0.0 App server.


              In 4.x, the xml parsing wasn't as strict as in JBoss-5.0. So even if the deployment descriptor was not following the dtd/xsd, the deployment went off fine in 4.x

              What is the problem and where i did mistake ..?


              The problem is in the ejb-jar.xml. Compare it against the dtd/xsd and see which element in that xml is causing problem. The stacktrace gives you an hint about the 'cmp-field' in that ejb-jar.xml :)

              • 4. Re: Error when deploying EAR file

                Hi Jaikiran,

                Thanks for your swift reply on my request.

                As you said, i have changed my ejb-jar.xml dtd/xsd name space from ejb2.1 to ejb3.0 as given below.

                EJB 2.1 NameSpace

                <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">


                EJB 3.0 NameSpace
                <ejb-jar version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd">


                Now the EAR file deployed and working fine after migration of dtd/xsd name space.I do have more than 500 files in my Jboss4.2.3 app server. i need to migrate all the ejb-jar.xml file from 2.1 to 3.0. But how can i miragte my all existing ejb2.3 to ejb3.0..?. Please help me out from such a complicated migration. Is there any other way to sort out this at one click (or) one time modification instead of mirgating every ejb-jar.xml file ?

                Kindly advise .. Thanks in advance.

                Thanks and Regards,
                Ganapathi sundaram.G





                • 5. Re: Error when deploying EAR file
                  jaikiran

                  After the changes you did, i am a bit confused now :)

                  I have a question - is your application an EJB2.x app or is it an EJB3 app?

                  • 6. Re: Error when deploying EAR file

                    Hi Jaikiran,

                    As of now, our application running on JBoss4.2.3 GA Application server and we are using EJB 2.1 in our application.
                    Now we have planned to migrate the EJB 2.1 to EJB 3.0.We have such deployment problems in JBoss 5.0.0 GA app server when we tried to migrate the EJB 2.1 to EJB 3.0. we have more than 500 deployment files in Jboss 4.2.3 Server. We need to upgrade all the ejb deployment files NameSpace with EJB3.0 one by one. To avoid the redundancy, i request you to assist me if any other alter solution available to migrate at one shot. Hope, now you understood what we are looking for.

                    Thanks and Regards,
                    Ganapathi sundaram.G

                    • 7. Re: Error when deploying EAR file

                      Hi Jaikiran,

                      Any luck on this.

                      As well tell me Why the JBoss5.x does not support the EJB 2.1 based xsd/dtd namespace when deploying..?

                      Thanks and Regards,
                      Ganapathi sundaram.G

                      • 8. Re: Error when deploying EAR file
                        jaikiran

                         

                        "ganapathysundarum" wrote:

                        As well tell me Why the JBoss5.x does not support the EJB 2.1 based xsd/dtd namespace when deploying..?



                        It does support. Infact that's the reason i was confused when you changed the xsd/dtd declaration in your ejb-jar.xml.

                        In my earlier post:
                        "jaikiran" wrote:

                        The problem is in the ejb-jar.xml. Compare it against the dtd/xsd and see which element in that xml is causing problem. The stacktrace gives you an hint about the 'cmp-field' in that ejb-jar.xml :)


                        I did not say that you have to change the xsd/dtd declarations in your ejb-jar.xml :) Instead you have to "fix" the ejb-jar.xml which is not following the rules set by the dtd/xsd.

                        Specifically, you have fix that section in (maybe one or more than one) ejb-jar.xml which has the "cmp-field" element at the wrong place. So you will have to do the following:

                        1) Open up the ejb-jar.xml which contains the cmp-field element.
                        2) Find the location of cmp-field in that xml and check under which element it is being used. Then compare that against the rules defined by the xsd http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd

                        That will tell you what has gone wrong.

                        If you are unable to figure out what is wrong then post the ejb-jar.xml which is running into issues. But i would recommend that you first give a try to see if you can find the problem :)

                        Finally, if you want to retain the behaviour of AS 4.x (i.e. allow the deployment to pass even if the xml is not as per the dtd) then follow the steps mentioned in this thread http://www.jboss.org/index.html?module=bb&op=viewtopic&t=150147#4208527