6 Replies Latest reply on May 12, 2009 12:22 PM by jesper.pedersen

    SchemaResolverDeployer and JBossXB

    jesper.pedersen

      So I'm trying to minimize the work I have to do inside my deployer chain by using the SchemaResolver as the base class.

      But I keep getting

      Caused by: java.lang.Exception: The xml ra15inoutjbossra.rar/META-INF/ra.xml is not well formed!
       at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:191)
       at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
       at org.jboss.jca.deployers.rar.RaXmlParsingDeployer.parse(RaXmlParsingDeployer.java:75)
       at org.jboss.jca.deployers.rar.RaXmlParsingDeployer.parse(RaXmlParsingDeployer.java:39)
       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:348)
      


      for my deployments even though the XML files are well-formed.

      Is there a test case or wiki page that describes how you would go about using this stuff ?

      I basically just need to get from the VirtualFile to the object that defines the metadata located in JBMETA.

        • 1. Re: SchemaResolverDeployer and JBossXB
          aloubyansky

          Looking at the helper, the error message is totally wrong. I guess, it's a resolver issues, i.e. there was not matching class binding registered in the resolver for the XML/schema being parsed.

          • 2. Re: SchemaResolverDeployer and JBossXB
            aloubyansky

            The helper was added to XB with issue https://jira.jboss.org/jira/browse/JBXB-191

            • 3. Re: SchemaResolverDeployer and JBossXB
              aloubyansky

              Enable TRACE for org.jboss.xb to see what's going on during parsing.

              • 4. Re: SchemaResolverDeployer and JBossXB
                jesper.pedersen

                It is probably a resolver issue since I didn't specify one directly in the deployer.

                TRACE shows that it failed to resolve the J2EE namespaces. The file looks like this

                <?xml version="1.0" encoding="UTF-8"?>
                
                <!-- $Id $ -->
                
                <connector xmlns="http://java.sun.com/xml/ns/j2ee"
                 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/connector_1_5.xsd"
                 version="1.5">
                
                 <vendor-name>Red Hat Middleware LLC</vendor-name>
                 <eis-type>Test RA</eis-type>
                 <resourceadapter-version>0.1</resourceadapter-version>
                
                 <resourceadapter>
                 <resourceadapter-class>org.jboss.jca.test.deployers.spec.rars.ra15inoutjbossra.TestResourceAdapter</resourceadapter-class>
                 <config-property>
                 <config-property-name>StringRAR</config-property-name>
                 <config-property-type>java.lang.String</config-property-type>
                 <config-property-value>StringFromRARProperties</config-property-value>
                 </config-property>
                 <outbound-resourceadapter>
                 <connection-definition>
                 <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.ra15inoutjbossra.TestManagedConnectionFactory</managedconnectionfactory-class>
                
                 <connectionfactory-interface>javax.resource.spi.ManagedConnection</connectionfactory-interface>
                 <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.ra15inoutjbossra.TestManagedConnection</connectionfactory-impl-class>
                 <connection-interface>org.jboss.jca.test.deployers.spec.rars.TestConnectionInterface</connection-interface>
                 <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.TestConnection</connection-impl-class>
                 </connection-definition>
                 <transaction-support>LocalTransaction</transaction-support>
                 <reauthentication-support>false</reauthentication-support>
                 </outbound-resourceadapter>
                 <inbound-resourceadapter>
                 <messageadapter>
                 <messagelistener>
                 <messagelistener-type>org.jboss.jca.test.deployers.spec.rars.MessageListener</messagelistener-type>
                 <activationspec>
                 <activationspec-class>org.jboss.jca.test.deployers.spec.rars.ra15inoutjbossra.TestActivationSpec</activationspec-class>
                 </activationspec>
                 </messagelistener>
                 </messageadapter>
                 </inbound-resourceadapter>
                 </resourceadapter>
                </connector>
                


                Do you have any examples of how to enable all the resolvers for J2EE (+ JEE) and JCA ? I'm using XB-2.0.1.GA.

                • 6. Re: SchemaResolverDeployer and JBossXB
                  jesper.pedersen

                  Installing the SchemaResolverConfig bean with all the JCA DTDs and XSDs did the trick (http://fisheye.jboss.com/changelog/JBossAS/projects/jboss-jca/trunk?cs=88744).