5 Replies Latest reply on Jul 30, 2003 8:54 AM by juhalindfors

    java.lang.NullPointerException

    mthoresen

      I have an BMP Entity Bean. Very simple. Remote works fine. But when I try to implement the local interface I get the following exception.


      java.lang.NullPointerException
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy0.findByPrimaryKey(Unknown Source)
      at counterparty.clients.localEntityBean.main(localEntityBean.java:31)
      Exception in thread "main" Process terminated with exit code 1

      the code for the client is basically this:

      public static void main(String[] args)
      {
      Properties env = new Properties( );
      env.put(Context.PROVIDER_URL, "localhost:1098");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      InitialContext ic = null;
      LocalCounterpartyEntity rec;
      CptyPK key = new CptyPK("PHIBRO INC.", "PHIBRO");
      try {
      ic = new InitialContext(env);
      LocalCounterpartyEntityHome localHome = (LocalCounterpartyEntityHome)ic.lookup("local/CounterpartyEntityEJB");
      rec = localHome.findByPrimaryKey(key);


      it craps out at the findByPrimaryKey.

      can anyone explain this to me and why it does not work? Help is much appreciated. (JNDI PORT is set to 1098)

      thanks.