From: J0Ke <do-...@jb...> - 2006-07-10 19:52:01
|
the code is the same : public static void main(String[] args) { InitialContext ctx; try { ctx = new InitialContext(); ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); ctx.addToEnvironment(Context.PROVIDER_URL, "jnp://localhost:1099"); SimpleSession simpleSession = (SimpleSession)ctx.lookup(SimpleSession.class.getName()); System.out.println(simpleSession.sayHello("EJB3")); } catch (NamingException e) { e.printStackTrace(); } stack : javax.naming.NameNotFoundException: beans.SimpleSession not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:296) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja when i try java:comp/env/beans/SimpleSession for name not SimpleSession.class.getName() i get javax.naming.NameNotFoundException: comp not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) at sun.rmi.transport.Transport$1.run(Transport.java:153) at java.security.AccessController.doPrivileged(Native Method) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956732#3956732 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956732 |