1 2 3 4 Previous Next 46 Replies Latest reply: May 4, 2009 3:24 AM by Jean Deruelle RSS

problem parsing sip.xml with JBossXB

Jean Deruelle Newbie

Hi,

First, sorry for the long post :-)

We are currently porting our implementation of Sip Servlets (see http://www.mobicents.org/products_sip_servlets.html) on top of JBoss 5 (currently working on Tomcat and Jboss AS 4.2.3).

Our source code for the port is currently available from http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5 (svn browsing)

Most of the work is done and working but we encoutered a problem related to JBossXB unmarshalling. I just hope anyone can help out there.

A bit of background related to sip servlets. It kind of reuses the same semantics from the http servlet 2.5 spec to provide support for the SIP protocol in a friendly manner to developers used to http servlets development.

So instead of having a web.xml deployment descriptor, pure sip servlets applications have a sip.xml instead.

the sip.xml corresponding xsd can be found at http://www.jcp.org/xml/ns/sipservlet/sip-app_1_1.xsd

We modified the metadata-deployer-jboss-beans.xml to add the sip.xml metadata parsing stuff by adding the following to the SchemaResolverConfig bean

 <!-- SipMetaData -->
<entry>
 <key>sip-app_1_1.xsd</key>
 <value>org.jboss.metadata.sip.spec.Sip11MetaData</value>
</entry>
<entry>
 <key>sip-app</key>
 <value>org.jboss.metadata.sip.jboss.JBossSip11MetaData</value>
</entry>


The first entry is the one causing the problem. It is used when the sip.xml contains the xmlns stuff in it for xsd validation. The corresponding class can be found here :
http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/spec/Sip11MetaData.java

The second one is used when xmlns stuff is not present and works fine.

The problem is have is when I try to deploy the following descriptor http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-examples/call-blocking/src/main/sipapp/WEB-INF/sip.xml

The part that is commented, when uncommented, gives me the following error when I deploy the app :
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: cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-name'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":servlet-name}' is expected. @ vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/call-blocking-1.2-SNAPSHOT.war/WEB-INF/sip.xml[16,17]
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.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-name'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":servlet-name}' is expected. @ vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/call-blocking-1.2-SNAPSHOT.war/WEB-INF/sip.xml[16,17]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.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)
... 30 more


the sip xsd import the web app 2.5 xsd through <xs:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="web-app_2_5.xsd"/>
to import the javaee servletType to define sip servlet in the sip.xml descriptor so it seems the xsd validation should be ok with regard to servlet type.

It is strange that it fails on servlet-name saying that servlet-name is expected.
Has anyone ever see this behavior or can help here ?
That would be greatly apprectiated.

Also I was wondering if the following was correct too ?
<sip-app xmlns="http://www.jcp.org/xml/ns/sipservlet"
 xmlns:javaee="http://java.sun.com/xml/ns/javaee">


because when I try to parse it it gives me the following :
org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/apitestapp.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.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: Null particle
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)
... 27 more
Caused by: java.lang.IllegalArgumentException: Null particle
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler$StackItem.(SundayContentHandler.java:1416)
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.push(SundayContentHandler.java:1341)
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:683)
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.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)
... 35 more

I think this is because it cannot find entry or class matching to do the unmarshalling but I don't know how to correct that neither...

Thanks in advance
Best regards
Jean Deruelle, Mobicents Team

  • 1. Re: problem parsing sip.xml with JBossXB
    Ales Justin Master

     

    "deruelle_jean" wrote:

    It is strange that it fails on servlet-name saying that servlet-name is expected.

    Do both - your schema and javaee - define servlet element?
    If so, maybe there's a confusion about which one to choose?
    Try adding a namespace infront of the element.

    btw: why the javaee schema import, as I see your metadata class has all the elements handled?

    ps: use code blocks for xml and mark all (you missed one :-) links as url - a lot easier to read ;-)

  • 2. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

     


    Do both - your schema and javaee - define servlet element?
    If so, maybe there's a confusion about which one to choose?

    Only the web app schema defines servletType, the sip app schema import the web app xsd to reuse this servletType for defining the servlet element. The web app servlet element is not used when you use the sip-app xsd. Not sure I'm clear here...

    Try adding a namespace infront of the element.


    I already tried that, no better :
    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://java.sun.com/xml/ns/javaee}servlet-name not found as a child of {http://www.jcp.org/xml/ns/sipservlet}servlet
    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://java.sun.com/xml/ns/javaee}servlet-name not found as a child of {http://www.jcp.org/xml/ns/sipservlet}servlet
    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


    btw: why the javaee schema import, as I see your metadata class has all the elements handled?


    In the xsd ? To be able to reuse the servletType defined by the web app xsd (also I have no control over the xsd, it has been written by the spec lead Oracle/BEA)

  • 3. Re: problem parsing sip.xml with JBossXB
    Ales Justin Master

    I think the problem is that you're trying to use ServletsMetaData from your SipMD w/o specifying that it belongs to different namespace than your SipMD.

    What about if you remove the javaee namespace from sip.xml?

  • 4. Re: problem parsing sip.xml with JBossXB
    Alexey Loubyansky Master

     

    Caused by: org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-name'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":servlet-name}' is expected. @ vfszip:/home/deruelle/servers/jboss-5.0.0.GA/server/default/deploy/call-blocking-1.2-SNAPSHOT.war/WEB-INF/sip.xml[16,17]


    So, it expects "http://java.sun.com/xml/ns/javaee":servlet-name
    Which means javaee:servlet-name in the xml.
    It won't work with the namespace declarations commented out.

  • 5. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

     

    "alesj" wrote:
    I think the problem is that you're trying to use ServletsMetaData from your SipMD w/o specifying that it belongs to different namespace than your SipMD.


    I tried adding a namespace to the annotation here http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/spec/SipMetaData.java?r=4255#213 to no avail

    I tried hacking my own SipServletsMetaData and SipServletMetaData to no avail neither

    "alesj" wrote:
    What about if you remove the javaee namespace from sip.xml?


    I tried that too same weird exception...

    the error actually comes from SAX it seems the sip.xml cannot be validated against the xsd...
    I wonder if there is something wrong with how the import is done in the sip.xsd[/url]

  • 6. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    In the meanwhile is there any way to disable xsd validation for a given entry in the SchemaResolverConfig bean ?

  • 7. Re: problem parsing sip.xml with JBossXB
    Alexey Loubyansky Master

    What about this?

    <sip-app xmlns="http://www.jcp.org/xml/ns/sipservlet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.jcp.org/xml/ns/sipservlet http://www.jcp.org/xml/ns/sipservlet/sip-app_1_1.xsd"
     xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xs="http://www.w3.org/2001/XMLSchema"
     version="1.1">
     <app-name>org.mobicents.servlet.sip.example.CallBlockingApplication</app-name>
    
     <servlet>
     <javaee:servlet-name>CallBlockingSipServlet</javaee:servlet-name>
     <javaee:servlet-class>org.mobicents.servlet.sip.example.CallBlockingSipServlet</javaee:servlet-class>
     <javaee:load-on-startup>1</javaee:load-on-startup>
     </servlet>
    </sip-app>


  • 8. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    This gives me :

    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://java.sun.com/xml/ns/javaee}servlet-name not found as a child of {http://www.jcp.org/xml/ns/sipservlet}servlet
    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://java.sun.com/xml/ns/javaee}servlet-name not found as a child of {http://www.jcp.org/xml/ns/sipservlet}servlet
    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

  • 9. Re: problem parsing sip.xml with JBossXB
    Alexey Loubyansky Master

    This seems like a SchemaBinding issue, i.e. the xml looks consistent with the XSD but the element not found in the SchemaBinding. I.e. Java annotations should specify the correct namespace. I'll look when later into this.

  • 10. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    What do you mean like adding the namespace to the Java XmlElement annotation on the setSipServlets method in my SipMetaData class ? (I http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/spec/SipMetaData.java?r=4255#213 )

    I tried that too but it didn't work neither. I even tried to create my own ServletsMetatData and ServletMetatData classes and add the namespace in the same way to the different setters present in the ServletMetatData class but it didn't work neither.

    Shall I create an issue somewhere ?
    Alternatively is this the correct link to checkout the JBossXB project http://anonsvn.jboss.org/repos/common/jbossxb ? I can try to write a sandboxed testcase to try to replicate the problem on a smaller scale by creating 2 simple xsd with one importing the other and try to validate a simple xml file.
    Is there any guidelines or test I could duplicate to create the above-mentionned testcase ?

    Thanks in advance and for looking into it and try to help me out, that is highly appreciated
    BR
    Jean

  • 11. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    What do you mean like adding the namespace to the Java XmlElement annotation on the setSipServlets method in my SipMetaData class ? (I http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/spec/SipMetaData.java?r=4255#213 )

    I tried that too but it didn't work neither. I even tried to create my own ServletsMetatData and ServletMetatData classes and add the namespace in the same way to the different setters present in the ServletMetatData class but it didn't work neither.

    Shall I create an issue somewhere ?
    Alternatively is this the correct link to checkout the JBossXB project http://anonsvn.jboss.org/repos/common/jbossxb ? I can try to write a sandboxed testcase to try to replicate the problem on a smaller scale by creating 2 simple xsd with one importing the other and try to validate a simple xml file.
    Is there any guidelines or test I could duplicate to create the above-mentionned testcase ?

    Thanks in advance and for looking into it and try to help me out, that is highly appreciated
    BR
    Jean

  • 12. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    In creating my own ServletsMetatData and ServletMetatData classes and add the XmlElement annotation for each setter present in specifying the javaee namespace in the ServletMetatData class + adding the XmlType annotation at the class level with the javaee namespace specified it worked but now if you don't specify any schema in the sip.xml which will call the JBossSip11MetaData (http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/jboss/JBossSip11MetaData.java) it fails because it seems it tries to lookup the javaee namespace always...

  • 13. Re: problem parsing sip.xml with JBossXB
    Alexey Loubyansky Master

     

    In creating my own ServletsMetatData and ServletMetatData classes and add the XmlElement annotation for each setter present in specifying the javaee namespace in the ServletMetatData class + adding the XmlType annotation at the class level with the javaee namespace specified it worked

    Yes, I don't see another workaround. There should be an annotation that would just bind the type and all its content to the specified namespace. This is what I would expect from @JBossXmlNsPrefix but it's effective only on the property's element name, the children will still be bound to the schema target/default namespace.

    but now if you don't specify any schema in the sip.xml which will call the JBossSip11MetaData (http://code.google.com/p/mobicents/source/browse/trunk/servers/sip-servlets/sip-servlets-jboss5/src/main/java/org/jboss/metadata/sip/jboss/JBossSip11MetaData.java ) it fails because it seems it tries to lookup the javaee namespace always...

    Because they are explicitly bound to javaee ns?

    If you want to create testcases, I'd suggest the metadata project.

  • 14. Re: problem parsing sip.xml with JBossXB
    Jean Deruelle Newbie

    I see that on XmlSchema (http://java.sun.com/javaee/5/docs/api/javax/xml/bind/annotation/XmlSchema.html) we can customize namespace prefix and namespace URI mapping (Example 2 in the above link) and it seems that should do the job (not 100% sure though)

    I was wondering if it was possible to do that on JBossXmlSchema annotation but it doesn't seem to work either...

    How hard would it be to support this ?
    Also not sure this is related at all but the 'namespace-prefixes' property for the SAXParser (http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description) is not set to true, I wonder if that would be better when set to true ?

    Because they are explicitly bound to javaee ns?

    Indeed, that forces me to create different set of classes depending of whether or not we are unmarshalling a sip.xml that has namespace defined or not, so I'm kind of duplicating the classes which is a sign of code smell. Also it complicates the code of the deployer because I have to get both metadata and push them into a third set of classes (on which I can do the merge with annotations, jboss-web.xml metadata and web.xml metadata to avoid duplicating the merge operation too) since I cannot know in advance if the sip.xml will have namespace or not...

1 2 3 4 Previous Next