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


-------------------------------------------------------------------------
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
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to