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

    Calling create method in a local home raises NullPointerExce

    Carlos Eugenio Newbie


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

      // - Code
      Properties props = new Properties();
      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
      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.