1 2 3 4 Previous Next 46 Replies Latest reply on May 4, 2009 3:24 AM by deruelle_jean Go to original post
      • 15. Re: problem parsing sip.xml with JBossXB
        aloubyansky

        I am going to enhance @JBossXmlNsPrefix.
        https://jira.jboss.org/jira/browse/JBXB-168
        Possibly tomorrow.

        • 16. Re: problem parsing sip.xml with JBossXB
          aloubyansky

          The issue is closed. If you can try XB trunk to see if it fixes the issue and let me know, it would be great.
          I think I'll be releasing JBossXB-2.0.1.Beta1 end of this week.

          • 17. Re: problem parsing sip.xml with JBossXB
            deruelle_jean

            I'm willing to try but not sure what I need to change to my code to use this new annotation ?
            just define a new @XmlNs(namespaceURI = "http://java.sun.com/xml/ns/javaee", prefix = "javaee") in the xmlns attribute of @JBossXmlSchema in my Sip11MetaData class or/and put this @JBossXmlNsPrefix annotation with javaee prefix for the setter (ie here setServlets in SipMetaData class) ?
            Do you have any examples of its usage ?

            Thanks in advance
            Jean

            • 19. Re: problem parsing sip.xml with JBossXB
              deruelle_jean

              Which JBoss AS 5 jar(s) should I replace to put the new jboss-xml-binding.jar?

              • 20. Re: problem parsing sip.xml with JBossXB
                aloubyansky

                Just replace jboss-xml-binding.jar.

                • 21. Re: problem parsing sip.xml with JBossXB
                  deruelle_jean

                  nevermind I found it in jboss-5.0.0.GA/lib with the same name...

                  • 22. Re: problem parsing sip.xml with JBossXB
                    deruelle_jean

                    it doesn't work for my usecase but after some thoughts maybe it's normal see my comments below the stacktrace
                    org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/call-blocking-1.2-SNAPSHOT.war
                    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.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(AbstractParsingDeployerWithOutput.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.java:1157)
                    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: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:781)
                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                    at org.jboss.Main.boot(Main.java:209)
                    at org.jboss.Main$1.run(Main.java:547)
                    at java.lang.Thread.run(Thread.java:595)
                    Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: {http://www.jcp.org/xml/ns/sipservlet}listener not found as a child of {http://www.jcp.org/xml/ns/sipservlet}sip-app
                    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)
                    ... 22 more
                    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {http://www.jcp.org/xml/ns/sipservlet}listener not found as a child of {http://www.jcp.org/xml/ns/sipservlet}sip-app
                    at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:400)
                    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.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)
                    ... 30 more


                    I think this is because servlet element is still in the sipservlet namespace only the childs of servlet element are in the javaee namespace (because the servlet element which is present in the sipapp xsd uses the servletType of the javaee schema).
                    So I wonder if I have any other choice than duplicating those classes...

                    • 23. Re: problem parsing sip.xml with JBossXB
                      deruelle_jean

                      It works if I duplicate the original ServletsMetaData and ServletMetaData classes and put the new annotation @JBossXmlNsPrefix(prefix="javaee", schemaTargetIfNotMapped=true)

                      Thanks

                      • 24. Re: problem parsing sip.xml with JBossXB
                        aloubyansky

                        There is nothing about the servlet element in the error. You have to annotate listener with JBossXmlNsPrefix as well. I don't see why you have to duplicate anything so far.

                        • 25. Re: problem parsing sip.xml with JBossXB
                          deruelle_jean

                          I copied paste the wrong exception sorry (this is because I tried it on listener as well)
                          so I have to duplicate the existing classes in metadata that are used by the sipapp xsd such as servletType(ServletsMetaData and ServletMetatData) or listenerType(ListenerMetaData) or another way would be to add those JBossXmlNs to the classes in the metadata project maybe :

                          org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/call-blocking-1.2-SNAPSHOT.war
                          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.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(AbstractParsingDeployerWithOutput.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.java:1157)
                          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: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:781)
                          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                          at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                          at org.jboss.Main.boot(Main.java:209)
                          at org.jboss.Main$1.run(Main.java:547)
                          at java.lang.Thread.run(Thread.java:595)
                          Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: {http://www.jcp.org/xml/ns/sipservlet}servlet not found as a child of {http://www.jcp.org/xml/ns/sipservlet}sip-app
                          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)
                          ... 22 more
                          Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {http://www.jcp.org/xml/ns/sipservlet}servlet not found as a child of {http://www.jcp.org/xml/ns/sipservlet}sip-app
                          at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:400)
                          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.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)
                          ... 30 more

                          • 26. Re: problem parsing sip.xml with JBossXB
                            aloubyansky

                            Yes, if you apply @JBossXmlNsPrefix to sipServlets then servlet element will be in the javaee namespace, so in xml you'll have 'javaee:servlet'.
                            If you can't get it to work please create a testcase somewhere (metadata preferable but you might not have commit rights) or send it to me.

                            • 27. Re: problem parsing sip.xml with JBossXB
                              deruelle_jean

                              exactly but the servlet element should stay in the sipservlet namespace as per the sipapp xsd.
                              This is why I said I needed to duplicate the existing metadata classes (everytime the sipapp xsd import a javaee type such as servletType or listenerType) and only apply the JBossXmlNsPrefix to the attributes of those duplicated classes.

                              I did that and it works like a charm.
                              Thanks for your help !

                              • 28. Re: problem parsing sip.xml with JBossXB
                                aloubyansky

                                Ok, right. I'll add support for that as well.

                                • 29. Re: problem parsing sip.xml with JBossXB
                                  deruelle_jean

                                  Please let me know once you added support for it. I'm definitely interested. In the meanwhile, I duplicated the classes I needed and everything is ok with the JBossXmlNsPrefix annotation.

                                  Thanks