12 Replies Latest reply on Jan 25, 2008 4:42 PM by snacker

    Using xinclude in config files

    starksm64

      Something I have been meaning to look at for a while now is whether we could use xinclude processing to allow the default dist config files to remain untouched by users. It seems to work as expected and can be used for this, but we need to make some changes to fully support it. First, a little testcase to illustrate some xinclude behaviors:

      package xml.xinclude;
      
      import java.io.FileNotFoundException;
      import java.io.IOException;
      import java.io.InputStream;
      
      import javax.xml.parsers.DocumentBuilderFactory;
      import javax.xml.parsers.DocumentBuilder;
      
      import org.junit.Test;
      import org.w3c.dom.Document;
      import org.w3c.dom.ls.DOMImplementationLS;
      import org.w3c.dom.ls.LSSerializer;
      
      /**
       * Basic tests of xinclude behavior.
       * @author Scott.Stark@jboss.org
       * @version $Revision:$
       */
      public class XIncludeTests
      {
       @Test
       public void testInclude() throws Exception
       {
       Document doc = getDocument("testInclude.xml");
       printDoc(doc);
       }
      
       @Test
       public void testIncludeFallback() throws Exception
       {
       Document doc = getDocument("testIncludeFallback.xml");
       printDoc(doc);
       }
      
       @Test
       public void testIncludeFallbackNoBaseUri()
       throws Exception
       {
       Document doc = getDocument("testIncludeFallback.xml",
       "http://apache.org/xml/features/xinclude/fixup-base-uris", false);
       printDoc(doc);
       }
      
       Document getDocument(String name) throws Exception
       {
       return getDocument(name, null, false);
       }
      
       Document getDocument(String name, String feature, boolean flag)
       throws Exception
       {
       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       dbf.setNamespaceAware(true);
       dbf.setXIncludeAware(true);
       if (feature != null)
       {
       dbf.setFeature(feature, flag);
       }
       DocumentBuilder builder = dbf.newDocumentBuilder();
       InputStream is = getResource(name);
       Document doc = builder.parse(is);
       is.close();
       return doc;
       }
      
       InputStream getResource(String name) throws IOException
       {
       InputStream is = getClass().getResourceAsStream(name);
       if (is == null)
       throw new FileNotFoundException(name);
       return is;
       }
      
       void printDoc(Document doc)
       {
       DOMImplementationLS ls = (DOMImplementationLS) doc.getImplementation()
       .getFeature("LS", "3.0");
       LSSerializer serializer = ls.createLSSerializer();
       System.out.println(serializer.writeToString(doc));
       }
      }
      


      testInclude.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <a name="a-name">
       <xi:include href="b.xml"
       xml:base="/home/starksm/java/workspace/JavaTests/src/xml/xinclude/"
       xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </a>
      


      b.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <b name="b-name">
       <c name="c-name" />
      </b>
      


      testIncludeFallback.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <a name="a-name">
       <xi:include href="b.xml"
       xmlns:xi="http://www.w3.org/2001/XInclude">
       <xi:fallback>
       <b name="fallback-b">
       <c name="fallback-c" />
       </b>
       </xi:fallback>
       </xi:include>
      </a>
      


      The resulting dom for the 3 tests are,
      testInclude:
      <?xml version="1.0" encoding="UTF-16"?>
      <a name="a-name">
       <b name="b-name" xml:base="/home/starksm/java/workspace/JavaTests/src/xml/xinclude/b.xml">
       <c name="c-name"/>
      </b>
      </a>
      


      testIncludeFallback:
      <?xml version="1.0" encoding="UTF-16"?>
      <a name="a-name">
      
       <b name="fallback-b" xml:base="" xmlns:xi="http://www.w3.org/2001/XInclude">
       <c name="fallback-c"/>
       </b>
      
      </a>
      


      testIncludeFallbackNoBaseUri:
      <?xml version="1.0" encoding="UTF-16"?>
      <a name="a-name">
      
       <b name="fallback-b" xmlns:xi="http://www.w3.org/2001/XInclude">
       <c name="fallback-c"/>
       </b>
      
      </a>
      


      The changes needed are:
      1. Come up with a convention of xml:base location and href to define where overriden config files go by default, and how the override files are names.
      2. Incorporate xinclude statements in the config files with fallbacks that correspond to the default out of the box configuration. For some config files we may want the xinclude statements on a per bean level, while others (jms destinations as an example) may only want an include on the root element.
      3. Enable xinclude processing on the dom/sax factories. If you don't call setXIncludeAware on the parser factory the xinclude statements are just passed through as is.
      4. Either rewrite the schemas/dtds to allow for xml:base in elements that are included, or be able to disable the base URI fixup as specified by the XInclude Recommendation.

      The profileservice removes the need for this, but until all managable content is editable via the profileservice, there still is a need for better override support, as well as the cases where a full featured profileservice is not being used.


        • 1. Re: Using xinclude in config files

          XInclude is already handled by JBossXB (if the parser supports it, which Xerces does).

          With the JBoss "resource:" url handler it is fairly trivial to include things from the classpath,
          e.g.

          <?xml version="1.0" encoding="UTF-8"?>
          
          
          <xi:include href="resource:org/jboss/some/path/included.xml"
           xmlns:xi="http://www.w3.org/2001/XInclude"/>
          
          


          If all the new deployers use the helper classes then it would be trivial
          to enable XInclude for their JAXP parsers as well.

          • 2. Re: Using xinclude in config files

            I think in general our elements should allow any attributes from other schemas
            like the xsd schema does with its types.
            IIRC, there is an open feature request to have "id" as well.


            • 3. Re: Using xinclude in config files
              snacker

              So will xinclude work with the config files dropped in deploy.last?

              We have multiple development environments and would like to do this:

              cachea-service.xml

              <?xml version="1.0" encoding="UTF-8"?>
              
              <server>
               <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
               <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=CacheA">
               <depends>jboss:service=Naming</depends>
               <depends>jboss:service=TransactionManager</depends>
               <depends>jboss:service=FarmMember,partition=${jboss.partition.name:DefaultPartition}</depends>
              
               <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
               <attribute name="IsolationLevel">NONE</attribute>
               <attribute name="CacheMode">REPL_ASYNC</attribute>
               <attribute name="ClusterName">CacheA-Cluster</attribute>
               <attribute name="ClusterConfig">
               <!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/cache-setup.xml" xpointer="element(/1/1)"/>
               <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/cache-setup.xml" xpointer="element(/1/2)"/-->
               <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/cache-setup.xml" xpointer="cache-config-a-tcp"/>
               <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/cache-setup.xml" xpointer="cache-config-a-tcpping"/>
               <MERGE2 min_interval="5000" max_interval="10000"/>
               <FD_SOCK />
               <FD shun="true" timeout="2500" max_tries="5" up_thread="true" down_thread="true" />
               <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false" />
               <pbcast.NAKACK down_thread="true" up_thread="true" gc_lag="100" retransmit_timeout="300,600,1200,2400,4800" />
               <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" down_thread="false" up_thread="false" max_bytes="2100000"/>
               <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="false" print_local_addr="true"/>
               <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
               </attribute>
              
               <attribute name="SyncReplTimeout">20000</attribute>
               <attribute name="InitialStateRetrievalTimeout">600000</attribute>
              
               <!-- Max number of milliseconds to wait for a lock acquisition -->
               <attribute name="LockAcquisitionTimeout">15000</attribute>
               <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
               <attribute name="EvictionPolicyConfig">
               <config>
               <attribute name="wakeUpIntervalSeconds">600</attribute>
               <region name="/_default_">
               <attribute name="maxNodes">10000</attribute>
               <attribute name="timeToIdleSeconds">14400</attribute>
               </region>
               </config>
               </attribute>
               </mbean>
              </server>
              



              config-setup.xml

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!DOCTYPE config-setup[
               <!ELEMENT config-setup (TCP|TCPPING)*>
               <!ELEMENT TCP EMPTY>
               <!ATTLIST TCP
               id ID #REQUIRED
               bind_addr CDATA #IMPLIED
               start_port CDATA #IMPLIED
               loopback CDATA #IMPLIED
               >
               <!ELEMENT TCPPING EMPTY>
               <!ATTLIST TCPPING
               id ID #REQUIRED
               initial_hosts CDATA #IMPLIED
               port_range CDATA #IMPLIED
               timeout CDATA #IMPLIED
               num_initial_members CDATA #IMPLIED
               up_thread CDATA #IMPLIED
               down_thread CDATA #IMPLIED
               >
              ]>
              
              <config-setup>
               <TCP id="cache-config-a-tcp" bind_addr="localhost" start_port="1111" loopback="true"/>
               <TCPPING id="cache-config-a-tcpping" initial_hosts="localhost[1111]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-b-tcp" bind_addr="localhost" start_port="1112" loopback="true"/>
               <TCPPING id="cache-config-b-tcpping" initial_hosts="localhost[1112]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-c-tcp" bind_addr="localhost" start_port="1113" loopback="true"/>
               <TCPPING id="cache-config-c-tcpping" initial_hosts="localhost[1113]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-e-tcp" bind_addr="localhost" start_port="1114" loopback="true"/>
               <TCPPING id="cache-config-e-tcpping" initial_hosts="localhost[1114]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-f-tcp" bind_addr="localhost" start_port="1115" loopback="true"/>
               <TCPPING id="cache-config-f-tcpping" initial_hosts="localhost[1115]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-g-tcp" bind_addr="localhost" start_port="1116" loopback="true"/>
               <TCPPING id="cache-config-g-tcpping" initial_hosts="localhost[1116]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-h-tcp" bind_addr="localhost" start_port="1117" loopback="true"/>
               <TCPPING id="cache-config-h-tcpping" initial_hosts="localhost[1118]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              
               <TCP id="cache-config-tc5-cluster-tcp" bind_addr="localhost" start_port="1119" loopback="true"/>
               <TCPPING id="cache-config-tc5-cluster-tcpping" initial_hosts="localhost[1119]" port_range="1" timeout="3500" num_initial_members="1" up_thread="true" down_thread="true"/>
              </config-setup>
              


              • 4. Re: Using xinclude in config files
                snacker

                Oops...

                /jboss/server/all/deploy/deploy.last/cache-setup.xml

                should have been
                /jboss/server/all/deploy/deploy.last/config-setup.xml


                • 5. Re: Using xinclude in config files
                  snacker

                  Compiling this:

                  import java.io.File;
                  import javax.xml.parsers.DocumentBuilder;
                  import javax.xml.parsers.DocumentBuilderFactory;
                  import javax.xml.transform.Result;
                  import javax.xml.transform.Source;
                  import javax.xml.transform.Transformer;
                  import javax.xml.transform.TransformerFactory;
                  import javax.xml.transform.dom.DOMSource;
                  import javax.xml.transform.stream.StreamResult;
                  import org.w3c.dom.Document;
                  
                  public class JunkXInclude{
                   public static void main( String[] args )throws Exception{
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   dbf.setNamespaceAware( true );
                   dbf.setXIncludeAware( true );
                   System.out.println( "dbf=" + dbf );
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   System.out.println( "db=" + db );
                   Document doc = db.parse( new File( null == args || 0 == args.length ? "/jboss/server/all/deploy/deploy.last/cachea-service.xml" : args[ 0 ] ) );
                   System.out.println( "doc=" + doc );
                   Source source = new DOMSource(doc);
                   Result result = new StreamResult( System.out );
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                   xformer.transform(source, result);
                   }
                  }
                  


                  ... and executing with this:

                  java -cp xml-apis.jar;xercesImpl.jar;serializer.jar;resolver.jar;. JunkXInclude


                  shows that it is properly included:
                  <?xml version="1.0" encoding="UTF-8" standalone="no"?><server>
                   <classpath archives="jboss-cache.jar, jgroups.jar" codebase="./lib"/>
                   <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=CacheA">
                   <depends>jboss:service=Naming</depends>
                   <depends>jboss:service=TransactionManager</depends>
                   <depends>jboss:service=FarmMember,partition=${jboss.partition.name:DefaultPartition}</depends>
                  
                   <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
                   <attribute name="IsolationLevel">NONE</attribute>
                   <attribute name="CacheMode">REPL_ASYNC</attribute>
                   <attribute name="ClusterName">CacheA-Cluster</attribute>
                   <attribute name="ClusterConfig">
                   <!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/config-setup.xml" xpointer="element(/1/1)"/>
                   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/jboss/server/all/deploy/deploy.last/config-setup.xml" xpointer="element(/1/2)"/-->
                   <TCP bind_addr="localhost" id="cache-config-a-tcp" loopback="true" start_port="7850" xml:base="/jboss/server/all/deploy/deploy.last/config-setup.xml"/>
                   <TCPPING down_thread="true" id="cache-config-a-tcpping" initial_hosts="localhost[7850]" num_initial_members="1" port_range="1" timeout="3500" up_thread="true" xml:base="/jboss/server/all/deploy/deploy.last/config-setup.xml"/>
                   <MERGE2 max_interval="10000" min_interval="5000"/>
                   <FD_SOCK/>
                   <FD down_thread="true" max_tries="5" shun="true" timeout="2500" up_thread="true"/>
                   <VERIFY_SUSPECT down_thread="false" timeout="1500" up_thread="false"/>
                   <pbcast.NAKACK down_thread="true" gc_lag="100" retransmit_timeout="300,600,1200,2400,4800" up_thread="true"/>
                   <pbcast.STABLE desired_avg_gossip="50000" down_thread="false" max_bytes="2100000" stability_delay="1000" up_thread="false"/>
                   <pbcast.GMS join_retry_timeout="2000" join_timeout="5000" print_local_addr="true" shun="false"/>
                   <pbcast.STATE_TRANSFER down_thread="true" up_thread="true"/>
                   </attribute>
                  
                   <attribute name="SyncReplTimeout">20000</attribute>
                   <attribute name="InitialStateRetrievalTimeout">600000</attribute>
                  
                   <!-- Max number of milliseconds to wait for a lock acquisition -->
                   <attribute name="LockAcquisitionTimeout">15000</attribute>
                   <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
                   <attribute name="EvictionPolicyConfig">
                   <config>
                   <attribute name="wakeUpIntervalSeconds">600</attribute>
                   <region name="/_default_">
                   <attribute name="maxNodes">10000</attribute>
                   <attribute name="timeToIdleSeconds">14400</attribute>
                   </region>
                   </config>
                   </attribute>
                   </mbean>
                  </server>
                  



                  • 6. Re: Using xinclude in config files
                    snacker

                    However it fails when using in the deploy.last directory of jboss (JBoss_4_0_3_SP1 date=200510231054)


                    15:49:08,784 INFO [ServiceConfigurator] Problem configuring service jboss.cache:service=CacheA
                    org.jboss.deployment.DeploymentException: Exception setting attribute ClusterConfig = [xi:include: null] on mbean jboss.cache:service=CacheA; - nested throwable: (java.lang.StringIndexOutOfBoundsException: String index out of range: -1)
                    at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:669)
                    at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:314)
                    at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:442)
                    at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:153)
                    at org.jboss.system.ServiceController.install(ServiceController.java:215)
                    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                    at $Proxy4.install(Unknown Source)
                    at org.jboss.deployment.SARDeployer.create(SARDeployer.java:232)
                    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
                    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
                    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                    at $Proxy9.deploy(Unknown Source)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
                    Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
                    at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:143)
                    at java.lang.StringBuffer.setLength(StringBuffer.java:153)
                    at org.jboss.cache.TreeCache.setClusterConfig(TreeCache.java:676)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:121)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                    at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:88)
                    at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:61)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                    at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:442)
                    at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:593)
                    at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:665)
                    ... 37 more


                    I replaced the xerces*.jar, xml-api.jar and xalan.jar in jboss/lib/endorsed with the most recent version ()
                    http://www.apache.org/dist/xerces/j/Xerces-J-bin.2.9.1.zip

                    Still didn't work.

                    Perhaps I need to use a more recent version of JBOSS???


                    • 7. Re: Using xinclude in config files

                       

                      "snacker" wrote:

                      I replaced the xerces*.jar, xml-api.jar and xalan.jar in jboss/lib/endorsed with the most recent version ()
                      http://www.apache.org/dist/xerces/j/Xerces-J-bin.2.9.1.zip

                      Still didn't work.

                      Perhaps I need to use a more recent version of JBOSS???


                      No, you need to set the system property (or ask on the Xerces mailing list
                      if it doesn't work).
                      http://xerces.apache.org/xerces2-j/faq-xni.html
                      Only JBossXB enables Xinclude by default, and only then in the most recent versions.


                      • 8. Re: Using xinclude in config files
                        snacker

                        Thanks, I will try that!

                        • 9. Re: Using xinclude in config files
                          snacker

                          It's not working...

                          I couldn't find any command/env properties to set, so I created a dummy DocumentBuilderFactory class which sets namespaceaware and xincludeaware to true then proxies all calls to org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.

                          package debug;
                          
                          import javax.xml.parsers.DocumentBuilder;
                          import javax.xml.parsers.DocumentBuilderFactory;
                          import javax.xml.parsers.ParserConfigurationException;
                          import javax.xml.validation.Schema;
                          
                          public class DebugDocumentBuilderFactory extends DocumentBuilderFactory{
                          
                           public static final String DEFAULT_FACTORY_IMPL_CLASS = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
                           public static final String PROP_FACTORY_IMPL_CLASS = "debug.factoryImplClass";
                           private final DocumentBuilderFactory m_dbf;
                          
                           public DebugDocumentBuilderFactory(){
                           String className = System.getProperty( PROP_FACTORY_IMPL_CLASS, DEFAULT_FACTORY_IMPL_CLASS );
                           try{
                           m_dbf = (DocumentBuilderFactory) Class.forName( className ).newInstance();
                           m_dbf.setNamespaceAware( true );
                           m_dbf.setXIncludeAware( true );
                           }catch( Exception e ){
                           throw new RuntimeException( "ERROR: could not create impl class " + className, e );
                           }
                           }
                          
                           ////////////////////
                           /// proxy all calls to implementation
                           ////////////////////
                           public DocumentBuilder newDocumentBuilder()throws ParserConfigurationException{ return m_dbf.newDocumentBuilder(); }
                           public void setAttribute( String name, Object value )throws IllegalArgumentException{ m_dbf.setAttribute( name, value ); }
                           public Object getAttribute( String name )throws IllegalArgumentException{ return m_dbf.getAttribute( name ); }
                           public void setFeature( String name, boolean value )throws ParserConfigurationException{ m_dbf.setFeature( name, value ); }
                           public boolean getFeature( String name )throws ParserConfigurationException{ return m_dbf.getFeature( name ); }
                           public Schema getSchema () { return m_dbf.getSchema (); }
                           public boolean isCoalescing () { return m_dbf.isCoalescing (); }
                           public boolean isExpandEntityReferences () { return m_dbf.isExpandEntityReferences (); }
                           public boolean isIgnoringComments () { return m_dbf.isIgnoringComments (); }
                           public boolean isIgnoringElementContentWhitespace () { return m_dbf.isIgnoringElementContentWhitespace (); }
                           public boolean isNamespaceAware () { return m_dbf.isNamespaceAware (); }
                           public boolean isValidating () { return m_dbf.isValidating (); }
                           public boolean isXIncludeAware () { return m_dbf.isXIncludeAware (); }
                           public void setCoalescing ( boolean coalescing ){ m_dbf.setCoalescing ( coalescing ); }
                           public void setExpandEntityReferences ( boolean expandEntityRef ){ m_dbf.setExpandEntityReferences ( expandEntityRef ); }
                           public void setIgnoringComments ( boolean ignoreComments ){ m_dbf.setIgnoringComments ( ignoreComments ); }
                           public void setIgnoringElementContentWhitespace ( boolean whitespace ){ m_dbf.setIgnoringElementContentWhitespace( whitespace ); }
                           public void setNamespaceAware ( boolean awareness ){ m_dbf.setNamespaceAware ( awareness ); }
                           public void setSchema ( Schema schema ){ m_dbf.setSchema ( schema ); }
                           public void setValidating ( boolean validating ){ m_dbf.setValidating ( validating ); }
                           public void setXIncludeAware ( boolean state ){ m_dbf.setXIncludeAware ( state ); }
                           public String toString(){
                           return super.toString() + "{" + m_dbf + "}" ;
                           }
                          }
                          



                          The error I'm getting looks like it is paritally working, because it does see the TCPPING element, but for some reason it says it's "null":


                          14:30:47,425 INFO [STDOUT] JAXP: find factoryId =javax.xml.parsers.DocumentBuilderFactory
                          14:30:47,425 INFO [STDOUT] JAXP: found system property, value=debug.DebugDocumentBuilderFactory
                          14:30:47,425 INFO [STDOUT] JAXP: created new instance of class debug.DebugDocumentBuilderFactory using ClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@4f80d6{ url=file:/C:/jboss/server/all/conf/ ,addedOrder=1}
                          14:30:47,425 INFO [ServiceConfigurator] Problem configuring service jboss.cache:service=CacheA
                           org.jboss.deployment.DeploymentException: Exception setting attribute ClusterConfig = [TCP: null] on mbean jboss.cache:service=CacheA; - nested throwable: (java.lang.StringIndexOutOfBoundsException: String index out of range: -1)
                           at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:669)
                           at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:314)
                           at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:442)
                           at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:153)
                           at org.jboss.system.ServiceController.install(ServiceController.java:215)
                           at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                           at $Proxy4.install(Unknown Source)
                           at org.jboss.deployment.SARDeployer.create(SARDeployer.java:232)
                           at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
                           at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
                           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
                           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
                           at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                           at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                           at $Proxy9.deploy(Unknown Source)
                           at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
                           at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                           at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
                           at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:265)
                           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
                           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
                           at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                           at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
                           at $Proxy0.start(Unknown Source)
                           at org.jboss.system.ServiceController.start(ServiceController.java:428)
                           at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                           at $Proxy4.start(Unknown Source)
                           at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
                           at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
                           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
                           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
                           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
                           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                           at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                           at $Proxy5.deploy(Unknown Source)
                           at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
                           at org.jboss.system.server.ServerImpl.start(ServerImpl.java:330)
                           at org.jboss.Main.boot(Main.java:187)
                           at org.jboss.Main$1.run(Main.java:438)
                           at java.lang.Thread.run(Thread.java:619)
                          Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
                           at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:143)
                           at java.lang.StringBuffer.setLength(StringBuffer.java:153)
                           at org.jboss.cache.TreeCache.setClusterConfig(TreeCache.java:676)
                           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                           at java.lang.reflect.Method.invoke(Method.java:597)
                           at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:121)
                           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                           at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:88)
                           at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:61)
                           at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                           at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:442)
                           at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:593)
                           at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:665)
                           ... 83 more
                          



                          • 10. Re: Using xinclude in config files
                            snacker

                            I can't get it to work with JBossXB with jboss app server 4.2.2GA:

                            13:08:30,076 INFO [ServiceConfigurator] Problem configuring service jboss.cache:service=CacheA
                            org.jboss.deployment.DeploymentException: Exception setting attribute ClusterConfig = [xi:include: null] on mbean jboss.cache:service=CacheA; - nested throwable: (java.lang.StringIndexOutOfBoundsException: String index out of range: -1)
                             at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:707)
                             at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:332)
                             at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:462)
                             at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
                             at org.jboss.system.ServiceController.install(ServiceController.java:226)
                             at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                             at $Proxy4.install(Unknown Source)
                             at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
                             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
                             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
                             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
                             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                             at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                             at $Proxy9.deploy(Unknown Source)
                             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                             at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
                             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                             at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                             at $Proxy0.start(Unknown Source)
                             at org.jboss.system.ServiceController.start(ServiceController.java:417)
                             at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                             at $Proxy4.start(Unknown Source)
                             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                             at $Proxy5.deploy(Unknown Source)
                             at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                             at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                             at org.jboss.Main.boot(Main.java:200)
                             at org.jboss.Main$1.run(Main.java:508)
                             at java.lang.Thread.run(Thread.java:619)
                            Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
                             at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:143)
                             at java.lang.StringBuffer.setLength(StringBuffer.java:153)
                             at org.jboss.cache.TreeCache.setClusterConfig(TreeCache.java:847)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:597)
                             at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:136)
                             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                             at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:103)
                             at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:76)
                             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                             at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:461)
                             at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
                             at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:703)
                             ... 83 more
                            


                            I will try the beta2 version, since you said it is only supported in the "most recent" version.

                            • 11. Re: Using xinclude in config files

                               

                              "snacker" wrote:
                              It's not working...

                              I couldn't find any command/env properties to set, so I created a dummy DocumentBuilderFactory class which sets namespaceaware and xincludeaware to true then proxies all calls to org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.


                              I've got no idea why it's not working. Ask the Apache Xerces project.
                              There is likely some nuance they can explain.

                              THIS IS NOT A JBOSS ISSUE, so there's little point trying to guess here.

                              I even tried hacking the configuration properties but that doesn't work either:
                              package test;
                              
                              public class MyXmlParserConfig extends org.apache.xerces.parsers.XIncludeAwareParserConfiguration
                              {
                               public MyXmlParserConfig()
                               {
                               setFeature(NAMESPACES, true);
                               setFeature(XINCLUDE_FEATURE, true);
                               }
                              
                              // OR Even more belt and braces:
                              
                               public boolean getFeature(String featureId) throws org.apache.xerces.xni.parser.XMLConfigurationException
                               {
                              
                               if (featureId.equals(NAMESPACES) || featureId.equals(XINCLUDE_FEATURE))
                               return true;
                               return super.getFeature(featureId);
                               }
                              }
                              


                              Neither works.

                              There's not point testing jboss5-Beta2. The SARDeployer where you report
                              your stacktrace uses a plain SAXParser not JBossXB.

                              • 12. Re: Using xinclude in config files
                                snacker

                                Yeah, I tried a hack similar to that, too.

                                So... I'm not using JBossXB.

                                Thought I was this last time.

                                Is there a setting to use JBossXB instead of the apache stuff?