[jboss-user] [Management, JMX/JBoss] - InokerAdaptorException in calling 'invoke' method
chanyungwan
do-not-reply at jboss.com
Wed Sep 6 03:19:07 EDT 2006
I have a 3.2.7 JBoss server 'A' with a registered MBean running on Linux 4 Enterprise Server. I then use another 3.2.7 JBoss server 'B' with another registered MBean running on Win2000 PC. I want to invoke the mbean method in serevr 'A' from the mbean in server 'B' using the following code:
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
env.put("java.naming.provider.url", "192.168.10.231");
try
{
InitialContext initialContext = new InitialContext(env);
javax.management.MBeanServerConnection m_localRMIAdaptor = (javax.management.MBeanServerConnection)initialContext.lookup("jmx/rmi/RMIAdaptor");
ObjectName m_singletonMBeanObjectName = new ObjectName("jboss.jmx:service=emmb");
Object oo = m_localRMIAdaptor.invoke(m_singletonMBeanObjectName, "getHashCode", null, null);
if(oo != null) System.out.println("ok, get result 1...");
}
catch(Exception e) { e.printStackTrace(); }
However, I get the following exception
14:54:47,416 INFO [STDOUT] javax.management.MBeanException: org.jboss.jmx.conne
ctor.invoker.client.InvokerAdaptorException
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.handl
eInvocationExceptions(ReflectedDispatcher.java:91)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispa
tch(ReflectedDispatcher.java:64)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invoc
ation.java:62)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invoc
ation.java:54)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocat
ion.java:82)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invo
ke(AbstractMBeanInvoker.java:198)
14:54:47,416 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:473)
14:54:47,416 INFO [STDOUT] at org.jboss.invocation.jrmp.server.JRMPProxyFac
tory.invoke(JRMPProxyFactory.java:164)
14:54:47,416 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor66.invoke(
Unknown Source)
14:54:47,416 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invo
ke(DelegatingMethodAccessorImpl.java:25)
14:54:47,432 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:5
85)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispa
tch(ReflectedDispatcher.java:60)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invoc
ation.java:62)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invoc
ation.java:54)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocat
ion.java:82)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invo
ke(AbstractMBeanInvoker.java:198)
14:54:47,432 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:473)
14:54:47,432 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invok
e(LocalInvoker.java:97)
14:54:47,432 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invok
eLocal(InvokerInterceptor.java:115)
14:54:47,432 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invok
e(InvokerInterceptor.java:101)
14:54:47,432 INFO [STDOUT] at org.jboss.jmx.connector.invoker.client.Invoke
rAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:60)
14:54:47,432 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(Se
curityInterceptor.java:55)
14:54:47,432 INFO [STDOUT] at org.jboss.proxy.ClientMethodInterceptor.invok
e(ClientMethodInterceptor.java:55)
14:54:47,432 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(Client
Container.java:86)
14:54:47,432 INFO [STDOUT] at $Proxy102.invoke(Unknown Source)
14:54:47,447 INFO [STDOUT] at sccMonitorHandler$compositeSingletonInvokerCl
ient.invoke(sccMonitorHandler.java:1086)
If the above code is running in 3.2.5, everything is fine. Are there any configurations I missed ? By the way, the above code also runs fine in a standalone client when invoking mbean method in 3.2.7 JBoss.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969645#3969645
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969645
More information about the jboss-user
mailing list