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();

 to 

private MyClass classContext=new MyClass();

in JNDIMap MBean That Implements Service Methods example.


When i am trying to lookup from outside applciation,it is giving null but when 
i tries to bind give:

javax.naming.NameAlreadyBoundException
  |     at org.jnp.server.NamingServer.bind(NamingServer.java:144)
  |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Mycode to lookup is:

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();
  |                         }




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

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


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to