-
1. Re: findMBeanServer
adrian.brock Oct 9, 2003 5:16 AM (in response to marcvh)Use the RMIAdaptor outside the virtual machine.
You can see it in jndi.
Regards,
Adrian -
2. Re: findMBeanServer
marcvh Oct 9, 2003 6:06 AM (in response to marcvh)I modified the code and I'm now using the RMIAdaptor:
// Lookup the state manager.
InitialContext ic = new InitialContext();
RMIAdaptor server = (RMIAdaptor)ic.lookup("jmx/rmi/RMIAdaptor");
ObjectName smObjectName = new ObjectName("jboss.mq:service=StateManager");
DynamicStateManager sm = (DynamicStateManager)server.getAttribute( smObjectName, "Instance");
now I get this exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.jboss.mq.sm.file.DynamicStateManager
jndi.Properties looks like this:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
# Do NOT uncomment this line as it causes in VM calls to go over
# RMI!
java.naming.provider.url=localhost
What's wrong here?
Marc. -
3. Re: findMBeanServer
adrian.brock Oct 9, 2003 6:10 AM (in response to marcvh)It is an MBean use invoke and get/setAttrbitue.
The Instance attribute is for the internal use of JBossMQ.
Regards,
Adrian -
4. Re: findMBeanServer
marcvh Oct 9, 2003 8:04 AM (in response to marcvh)It works now.
Thanks!
If I need to do the same thing from within a bean, do I use the same code or do I use the code I used before? (findMBeanServer etc.) -
5. Re: findMBeanServer
marcvh Oct 9, 2003 9:08 AM (in response to marcvh)This code works from within a bean:
// Add role_id to jbossmq_state.xml using DynamicStateManager
ObjectName smObjectName = new ObjectName("jboss.mq:service=StateManager");
// Lookup the state manager.
List srvrList = MBeanServerFactory.findMBeanServer(null);
MBeanServer server =(MBeanServer)srvrList.iterator().next();
DynamicStateManager sm = (DynamicStateManager)server.getAttribute( smObjectName, "Instance");
So my problem is solved.
Thanks for the hints!
Regards,
Marc vanhoecke
Project Leader
B. Rekencentra NV