-
1. Re: How to lookup RMI Adapter
genman Jun 6, 2005 6:12 PM (in response to sivaku)Perhaps your jndi.properties is not set?
-
2. Re: How to lookup RMI Adapter
anil.saldhana Jun 6, 2005 11:30 PM (in response to sivaku)Looks like there may be an additional jndi.properties somewhere that is being used instead of the one you provided.
Have you specified a jndi.properties file? -
3. Re: How to lookup RMI Adapter
anil.saldhana Jun 6, 2005 11:32 PM (in response to sivaku)Ignore my last post. I was answering a similar post without refreshing the browser.
-
4. Re: How to lookup RMI Adapter
anil.saldhana Jun 6, 2005 11:41 PM (in response to sivaku)http://wiki.jboss.org/wiki/Wiki.jsp?page=JNDIClientConfiguration
Also, use MBeanServerConnection instead of RMIAdaptor.import javax.management.MBeanServerConnection; .... protected MBeanServerConnection rmiserver = null; private void getMBeanServer(InitialContext ctx) { if (ctx == null) throw new IllegalArgumentException("Initial Context passed is null"); try { rmiserver = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor"); } catch (NamingException e) { log.debug(e); } if (rmiserver == null) throw new IllegalStateException( "MBeanServerConnection is null"); }
MBeanServerConnection represents the MBeanServer and you can invoke operations as follows:/** * Invoke an Operation on the MBean * * @param oname ObjectName of the MBean * @param methodname Name of the operation on the MBean * @param pParams Arguments to the operation * @param pSignature Signature for the operation. * @return result from the MBean operation * @throws Exception */ public Object invokeOperation(ObjectName oname, String methodname, Object[] pParams, String[] pSignature) throws Exception { Object result = null; if( rmiserver == null) throw new IllegalStateException( "MBeanServerConnection is null"); try { result = rmiserver.invoke(oname, methodname, pParams, pSignature); } catch (Exception e) { log.debug(e); } return result; }
-
5. Re: How to lookup RMI Adapter
sivaku Jun 7, 2005 5:38 AM (in response to sivaku)jndi.properties is set,still i am getting the same error.
-
6. Re: How to lookup RMI Adapter
adrian.bigland Jun 7, 2005 9:35 AM (in response to sivaku)It may be obvious but if you can, write a little code that iterates over the
naming enumeration of your initial context, and print out what content it has, if any. This might give you a better idea of which naming service you are actaully connected to.
You could compare this with the JNDIView list you get from the JMX console - if the two differ then you are not connecting to the JNDI tree you thought you were connecting to.
This doesn't solve your problem, of course, but it might make things a bit clearer. If you can iterate to the adapter but can't look it up directly this would probably mean a spelling mistake in the JNDI name, for example.