0 Replies Latest reply on Sep 12, 2005 9:16 PM by ballen

    StatelessLocalProxy throws NullPointerException

    ballen

      Attempting to access a SLSB from outside the container is resulting in both a NullPointerException, and a big headache for me.

      the JNDI lookup:

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "jnp://localhost:1099/");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      InitialContext ctx = new InitialContext(env);
      
      _myEJB = (MyEJB) ctx.lookup(MyEJB.class.getName());
      _myEJB.soSomething()

      causes:
      java.lang.NullPointerException
       at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:63)
       at $Proxy0.doSomething(Unknown Source)


      As you can see i am not getting a NameNotFoundException, so the JNDI lookup has succeeded; i just cannot do anything meaningful with the proxy. Curiously, if i give the SLSB a name using @RemoteBinding(jndiName="George"), then everything works as expected.
      Also, the same lookup from within the container works fine.

      We are currently using:
      - jboss-1.0.4rc1
      - ejb-3.0-Preview5

      Anyone care to venture an opinion as to what is happening?

      regards/brett