2 Replies Latest reply on Oct 15, 2007 2:42 PM by starksm64

    XsdBinder status

    starksm64

      I ran into an error in the jboss-metadata project where a ejb-jar.xml that was parsed in one test failed to parse in another. It turned out the schema resolver has not been configured correctly in the latter case, and the XsdBinder was being used to build the schema from the xsd rather than the xsd location being mapped to the EjbJar21MetaData jaxb annotated class in the passing test.

      We do use the XsdBinder for a number of schemas. I guess it cannot handle the ejb-jar_2_1.xsd though. I expect we are moving toward the jaxb/jbossxb annotations and deprecating XsdBinder?

        • 1. Re: XsdBinder status
          aloubyansky

          It is still used in WS for example. But I don't understand the problem.

          • 2. Re: XsdBinder status
            starksm64

            If you comment out the ejb-jar_2_1.xsd config line in JBoss50UnitTestCase.initResolver:

             public static SchemaBindingResolver initResolver()
             {
             DefaultSchemaResolver resolver = new DefaultSchemaResolver();
             //resolver.addClassBindingForLocation("ejb-jar_2_1.xsd", EjbJar21MetaData.class);
            ...
            


            The EjbJar21Everything_testEverything.xml fails to parse with:

            org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/home/svn/JBossHead/projects/metadata/trunk/target/eclipse-classes/org/jboss/test/metadata/ejb/EjbJar21Everything_testEverything.xml@1258,56
            ...
            Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to start {http://java.sun.com/xml/ns/j2ee}ejb-relationship-role: the element is not repeatable, repeatable parent expected to be a model group but got element {http://java.sun.com/xml/ns/j2ee}ejb-relation
            at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endRepeatableParent(SundayContentHandler.java:695)
            at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:334)
            at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:402)
            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:180)
            ... 21 more