5 Replies Latest reply on Aug 9, 2003 5:53 AM by brice

    Calling create method in a local home raises NullPointerExce

    carloseugenio

      Hi,

      I'm using a simple example of accessing an EntityBean with a local interface. The code looks like this:

      // - Code
      ...
      Properties props = new Properties();
      props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      props.put("java.naming.provider.url","localhost:1099");
      Context initial = new InitialContext(props);
      Object objref = initial.lookup("ejb/LocalUsuarioEJB");
      LocalUsuarioHome home = (LocalUsuarioHome)objref;
      System.out.println("Home: " + home);
      LocalUsuarioRemote user1 = home.create(new Integer(1));

      // - Code

      The problem is that everything works fine util the call to home.create(...). I get this message:

      // - Error

      Home: ejb/LocalUsuarioEJBHome
      Exception: java.lang.NullPointerException
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy0.create(Unknown Source)
      at Client.main(Client.java:38)

      // - Error.

      I've been looking for the solution for three days by now. Could anyone help?

      Thanks in advance,

      Carlos Eugenio.