I want to register my mbean with JNDI so that a client can retrieve the JNDIName and 
use the mbean. It works when I use the RMIAdapter instead, but I wanted to try the 
JNDI way.

I bound my mbean to JNDI as follows (jndiname is "inmemory/maps/MapTest2":

 
  |        InitialContext rootCtx = new InitialContext();
  |        Name fullName = rootCtx.getNameParser("").parse(jndiName);
  |        NonSerializableFactory.rebind(fullName, this, true);
  | 

And obviously, it could be bound successfully because when I look at the JNDIView list 
of names, I can see the following:

+- inmemory (class: org.jnp.interfaces.NamingContext)
  |   +- maps (class: org.jnp.interfaces.NamingContext)
  |   |   +- MapTest2 (class: mytest.mbean.JNDIMap)
  

My client application tries to access the service now as follows:


  | Object obj = getContext().lookup ("inmemory/maps/MapTest2");
  | mytest.mbean.JNDIMap map = (mytest.mbean.JNDIMap)PortableRemoteObject.narrow(obj, 
mytest.mbean.JNDIMap.class);              
  | 

But it does not work. map is null. What is wrong with that code? Can anybody help me?

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

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


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to