[jboss-dev-forums] [Design of Management Features on JBoss] - Re: Using xinclude in config files

snacker do-not-reply at jboss.com
Fri Nov 16 16:50:16 EST 2007


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 at 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
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105687#4105687

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105687



More information about the jboss-dev-forums mailing list