9 Replies Latest reply on Jan 28, 2009 2:54 PM by Wolfgang Knauf

    JBoss-5 CR2: jboss.xml with xsd declaration fails to deploy

    jaikiran pai Master

      One of the users reported in the Beginners Forum that he was having problem deploying a application with jboss.xml with a xsd declaration http://www.jboss.com/index.html?module=bb&op=viewtopic&t=146290.

      I decided to give it a try on my local JBoss-5 CR2 setup and no matter how simple the jboss.xml is, it always fails with the following exception:

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      vfsfile:/D:/jboss-5.0.0.CR2/server/jaikiran/deploy/myapp_ejb3.jar/ -> org.jboss.xb.binding.JBossXBRuntimeException: Element {http://www.jboss.org/j2ee/schema/}jboss is not bound as a global element.
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:709)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      14:40:53,079 ERROR [AbstractKernelController] Error installing to Parse: name=vfsfile:/D:/jboss-5.0.0.CR2/server/jaikiran/deploy/myapp_ejb3.jar/ state=Not Installed mode=Manual requiredState=Parse
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/D:/jboss-5.0.0.CR2/server/jaikiran/deploy/myapp_ejb3.jar/
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:343)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:303)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:275)
       at org.jboss.deployment.JBossEjbParsingDeployer.createMetaData(JBossEjbParsingDeployer.java:105)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:236)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
       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:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       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.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       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:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
       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.java:199)
       at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java: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(AbstractVFSParsingDeployer.java:256)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:329)
       ... 28 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:667)
       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.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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
      14:40:53,313 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
      
      vfsfile:/D:/jboss-5.0.0.CR2/server/jaikiran/deploy/myapp_ejb3.jar/ -> org.jboss.xb.binding.JBossXBRuntimeException: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
      


      The jboss.xml is (very simple):
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.org/j2ee/schema
       http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
       version="5.0">
      
      </jboss>


      I picked up the xsd declaration from the %JBOSS_HOME%\docs\schema\jboss_5_0.xsd which has the following comments:

      <xsd:annotation>
      <xsd:documentation>
      <![CDATA[

      This is the XML Schema for the JBoss 5.0 deployment descriptor.
      The deployment descriptor must be named "META-INF/jboss.xml" in
      the EJB's jar file. All EJB deployment descriptors must indicate
      the JBoss schema by using the Java EE namespace:

      http://www.jboss.org/j2ee/schema

      and by indicating the version of the schema by
      using the version element as shown below:

      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.jboss.org/j2ee/schema
      http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
      version="5.0">
      ...
      </jboss>

      The instance documents may indicate the published version of
      the schema using the xsi:schemaLocation attribute for the
      Java EE namespace with the following location:

      http://www.jboss.org/j2ee/schema/jboss_5_0.xsd

      ]]>
      </xsd:documentation>
      </xsd:annotation>


        • 1. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
          David Lloyd Master

          Looks to me like the http://www.jboss.org/j2ee/schema URI needs to be registered wtih JAXB by the jboss.xml deployer...

          • 2. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
            Arabinda Choudhury Newbie

            Hi David, what is the solution for the above problem. Me too facing the similar problem. I tried migrate my application from Jboss 4.2 to jboss 5 CR2. On jboss4.2, my jboss.xml looks similar like this

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

            <enterprise-beans>

            <ejb-name>MyState</ejb-name>
            <local-jndi-name>MyStateLocal</local-jndi-name>
            <configuration-name>EntityBean with cache invalidation</configuration-name>

            <method-attributes>

            <method-name>get*</method-name>
            <read-only>true</read-only>

            </method-attributes>

            <cache-invalidation>true</cache-invalidation>



            This was working fine without any issue.When I did the migration on AS5 CR2 I got the below error
            2008-12-01 17:11:32,897 ERROR [ejbloader.ejb.MetaData] (main) org.jboss.xb.binding.JBossXBException: Failed to parse source: vfszip:/usr/java/jboss/server/default/deploy/My.ear/My-Entities.jar/META-INF/jboss.xml@3,8
            2008-12-01 17:11:32,897 ERROR [STDERR] (main) org.jboss.xb.binding.JBossXBException: Failed to parse source: vfszip:/usr/java/jboss/server/default/deploy/My.ear/My-Entities.jar/META-INF/jboss.xml@3,8
            2008-12-01 17:11:32,898 ERROR [STDERR] (main) at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177)
            2008-12-01 17:11:32,898 ERROR [STDERR] (main) at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:119)
            2008-12-01 17:11:32,898 ERROR [STDERR] (main) at ejb.MetaData.getJBossMetaData(MetaData.java:189)
            2008-12-01 17:11:32,898 ERROR [STDERR] (main) at ejbloader.ejb.MetaData.getJbossMeta(MetaData.java:162)

            I then changed the DoCtype declaration as below
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">

            but still got the same error as the above one.

            I than added the namespace to jboss tag like the following way
            <jboss xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.jboss.com/xml/ns/javaee"
            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
            xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="5.0">


            and now got the error as Jai mentioned above(jboss is not bound as the global element). Please help and give some technical inputs to resolve the issue.

            • 3. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
              David Lloyd Master

              Well I can tell you that http://www.w3.org/2001/XMLSchema" is not the right namespace for jboss.xml - that's the XSD namespace. And targetNamespace is used by schemas... what you're trying there is about 10 kinds of wrong.

              I'd try a (correct) jboss.xml deployment in a fresh trunk build of AS5, and if it still doesn't work then it's probably a bug.

              • 4. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
                Arabinda Choudhury Newbie

                Thanks David. Earlier I tried with the correct namespace as well (One provided by Jai) but there also I got error(Failed to parse source: Jboss is not bound as a global element). Please do update us all with your valuable tips for jboss.xml.

                • 6. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
                  jaikiran pai Master

                  I haven't been able to put some more time into seeing what exactly is wrong with the schema shipped in JBoss. But if you are looking for a workaround, see the reply from "jhsingle" dated Wed Nov 26, 2008 10:51 AM in the thread that i referred in my first post in this thread.

                  • 7. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
                    David Lloyd Master

                    I don't have any update, I'm not working on this issue. See my last post.

                    • 8. Re: JBoss-5 CR2: jboss.xml with xsd declaration fails to dep
                      jaikiran pai Master

                      I ran into this on JBoss-5.0 GA today. The jboss_5_0.xsd in the %JBOSS_HOME%/docs/schema folder mentions this:

                      This is the XML Schema for the JBoss 5.0 deployment descriptor.
                       The deployment descriptor must be named "META-INF/jboss.xml" in
                       the EJB's jar file. All EJB deployment descriptors must indicate
                       the JBoss schema by using the Java EE namespace:
                      
                       http://www.jboss.org/j2ee/schema
                      
                       and by indicating the version of the schema by
                       using the version element as shown below:
                      
                       <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://www.jboss.org/j2ee/schema
                       http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
                       version="5.0">
                       ...
                       </jboss>



                      As per these instructions, i added the following to my jboss.xml:

                      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://www.jboss.org/j2ee/schema
                       http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
                       version="5.0">
                      ...
                      </jboss>


                      This results in deployment failure with the following exception:


                      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
                       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.java:199)
                       at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java: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(AbstractVFSParsingDeployer.java:256)
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:323)
                       ... 28 more
                      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
                       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:667)
                       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.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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
                      


                      I am not an expert on XML Schema, but based on my understanding, the jboss_5_0.xsd in the docs/schema folder should have instead mentioned using the following in jboss.xml:

                      <jboss xmlns:xs="http://www.jboss.org/j2ee/schema"
                       xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"
                       version="5.0">


                      So i decided to give this a try in my jboss.xml. And it worked!

                      Is this a bug then, in the xsd documentation?

                      P.S: I also notice that the xsd at http://www.jboss.org/j2ee/schema/jboss_5_0.xsd does not exactly match with the one that is shipped in JBoss-5.0 GA docs/schema folder.