0 Replies Latest reply on Oct 13, 2006 3:25 PM by nicolas.bielza

    NPE in org.jboss.ejb3.ProxyUtils.handleCallLocally

    nicolas.bielza

      Hello,

      I'm using the embedded EJB3 container. I did not find this issue in Jira but it looks to me like a bug:
      Whenever I call equals(null) on an EJB I get a NPE.

      The following code demonstrates the bug:

      InitialContext ctx = new InitialContext();
      Manager m = (Manager)ctx.lookup("ManagerAction/local");
      try {
      if(m != null) {
      m.equals(null);
      }
      System.err.println("What bug ???");
      } catch(NullPointerException e) {
      System.err.println("ProxyUtils NPE bug detected.");
      e.printStackTrace();
      }

      here's the output:

      ProxyUtils NPE bug detected.
      java.lang.NullPointerException
      at org.jboss.ejb3.ProxyUtils.handleCallLocally(ProxyUtils.java:156)
      at org.jboss.ejb3.ProxyUtils.handleCallLocally(ProxyUtils.java:137)
      at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:68)
      at $Proxy32.equals(Unknown Source)
      at com.alligacom.nett.NetTransferAdminInterface.(NetTransferAdminInterface.java:49)
      at com.alligacom.nett.NetTransferAdminInterface.main(NetTransferAdminInterface.java:87)



      Looking at ProxyUtils.handleCallLocally, this is where the NPE occurs:

      return new Boolean(ih.toString().equals(args[0].toString()));

      If the argument to equals is null, then args[0] is null, and the NPE happens.

      This bug makes it virtually impossible to use stateful session beans when using Seam with Jetty (because jetty tests the equality of the new value with the previous one when adding an object to the Http session, when a new key is inserted into the session, the previous value is always null).

      Shall I report this problem to Jira ?

      Thanks,
      Nicolas.