Scott,
I am also having no luck with your method. Here are the details.
Any ideas??
| public static ObjectName createServletMBean(MBeanServer server)
| throws Exception {
| Object info = null;
| ObjectName oname = new ObjectName(cache_service);
| ClassLoader loader = Thread.currentThread().getContextClassLoader();
| URL servletInfoURL = loader.getResource("META-INF/treecache-xmbean.xml");
| System.out.println(servletInfoURL.toString());
| server = MBeanServerFactory.createMBeanServer();
|
| // I tried both of the below methods, with same results
| Descriptor d = new DescriptorSupport();
| d.setField(XMBeanConstants.RESOURCE_REFERENCE, new TreeCacheAop());
| d.setField(XMBeanConstants.RESOURCE_TYPE, servletInfoURL.toString());
|
| XMBean xmbean = new XMBean(d, XMBeanConstants.DESCRIPTOR);
|
| XMBean xmbean = new XMBean(new TreeCacheAop(), servletInfoURL);
|
| server.registerMBean(xmbean, oname);
| return oname;
| }
|
|
Here is the xml file
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.1//EN"
"http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_1.dtd">
| <mbean>
| <description>This is an XMBean that proxies to the TreeCacheAop</description>
| <class>org.jboss.cache.aop.TreeCacheAop</class>
| <operation>
| <description>Put an element (key/value) in the hashmap of a given
node</description>
| <name>putObject</name>
| <parameter>
| <name>fqn</name>
| <type>java.lang.String</type>
| <description>The FQN of the node</description>
| </parameter>
| <parameter>
| <name>obj</name>
| <type>java.lang.Object</type>
| <description>The object</description>
| </parameter>
| <return-type>java.lang.Object</return-type>
| </operation>
| <operation>
| <description>Put an element (key/value) in the hashmap of a given
node</description>
| <name>putObject</name>
| <parameter>
| <name>fqn</name>
| <type>org.jboss.cache.Fqn</type>
| <description>The FQN of the node</description>
| </parameter>
| <parameter>
| <name>obj</name>
| <type>java.lang.Object</type>
| <description>The object</description>
| </parameter>
| <return-type>java.lang.Object</return-type>
| </operation>
| </mbean>
Here is the exception
Error parsing the XML file, from XMLMetaData:
09:27:24,853 INFO [STDOUT] org.jboss.mx.util.JBossNotCompliantMBeanException: Error
parsing the XML file, from XMLMetaData:
09:27:24,853 INFO [STDOUT] at
org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:290)
09:27:24,853 INFO [STDOUT] at org.jboss.mx.modelmbean.XMBean.(XMBean.java:219)
09:27:24,853 INFO [STDOUT] at
cachetest.TesterBean.createServletMBean(TesterBean.java:112)
09:27:24,853 INFO [STDOUT] at
cachetest.TesterBean.setSessionContext(TesterBean.java:42)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:47)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:35)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:146)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:58)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
09:27:24,869 INFO [STDOUT] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:314)
09:27:24,884 INFO [STDOUT] at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
09:27:24,884 INFO [STDOUT] at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
09:27:24,884 INFO [STDOUT] at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
09:27:24,884 INFO [STDOUT] at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
09:27:24,900 INFO [STDOUT] at
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:572)
09:27:24,900 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:889)
09:27:24,900 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
09:27:24,900 INFO [STDOUT] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:27:24,900 INFO [STDOUT] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:27:24,900 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
09:27:24,915 INFO [STDOUT] at
org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
09:27:24,994 INFO [STDOUT] at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:45)
09:27:24,994 INFO [STDOUT] at
org.jboss.mx.server.Invocation.invoke(Invocation.java:70)
09:27:24,994 INFO [STDOUT] at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:168)
09:27:24,994 INFO [STDOUT] at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:469)
09:27:24,994 INFO [STDOUT] at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
09:27:25,103 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
09:27:25,103 INFO [STDOUT] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:27:25,103 INFO [STDOUT] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:27:25,103 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
09:27:25,103 INFO [STDOUT] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
09:27:25,103 INFO [STDOUT] at
sun.rmi.transport.Transport$1.run(Transport.java:148)
09:27:25,103 INFO [STDOUT] at java.security.AccessController.doPrivileged(Native
Method)
09:27:25,103 INFO [STDOUT] at
sun.rmi.transport.Transport.serviceCall(Transport.java:144)
09:27:25,103 INFO [STDOUT] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
09:27:25,103 INFO [STDOUT] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
09:27:25,353 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
09:27:25,353 INFO [STDOUT] Caused by: org.dom4j.DocumentException: Error on line 12
of document
jar:file:/E:/jboss-head/build/output/jboss-4.0.0DR3/server/all/tmp/deploy/tmp15810CacheTest.jar!/META-INF/treecache-xmbean.xml
: Element "parameter" allows no further input; "description" is not allowed. Nested
exception: Element "parameter" allows no further input; "description" is not allowed.
09:27:25,353 INFO [STDOUT] at org.dom4j.io.SAXReader.read(SAXReader.java:339)
09:27:25,384 INFO [STDOUT] at org.dom4j.io.SAXReader.read(SAXReader.java:218)
09:27:25,384 INFO [STDOUT] at
org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:245)
09:27:25,400 INFO [STDOUT] ... 36 moreanonymous wrote :
<a
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3827321#3827321">View
the original post</a>
<a
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3827321>Reply
to the post</a>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development