Hi,
I want to bind my class object to jndi.I have created MBEAN taking help from following link :
http://www.huihoo.com/jboss/online_manual/3.0/ch13s26.html
just changed
private HashMap contextMap = new HashMap();
private MyClass classContext=new MyClass();
javax.naming.NameAlreadyBoundException at org.jnp.server.NamingServer.bind(NamingServer.java:144) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
InitialContext initialContext = null;
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
environment.put(Context.PROVIDER_URL, "jnp://localhost:1099");
try {
initialContext = new InitialContext(environment);
initialContext.bind("WebServiceInvoker",new WebServiceInvoker());
Object webserviceURL=initialContext.lookup("WebServiceInvoker");
System.out.println(webserviceURL);
} catch (NamingException e) {
e.printStackTrace();
}