1 Reply Latest reply on Feb 13, 2004 10:39 AM by acoliver

    NullPointer when invoking method on SessionBean

    gweb

      I get a weird NullPointerException when i invoke a method pairHullATISCode on my StatefulSessionBean. When I invoke another method of this bean, all works fine. Strangly the only log of this error is the one below:

      ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at be.tinc.bkw.core.BKWUserSessionBean.pairHullATISCode(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:878)at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:271)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatefulSessionContainer.internalInvoke(StatefulSessionContainer.java:410)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      ...

      I'm using JBoss 3.2.1, most of the time I'm understand the exceptions that I cause, but the this makes me lose my hair.
      Greetings
      G

        • 1. Re: NullPointer when invoking method on SessionBean
          acoliver

          this is almost certainly a bug in your code. Compile with the -g option (or debug="true" in the ant javac task) and you'll get line numbers. That would make things easier wouldn't it? If I had to venture to guess, I'd say that you pull something from the database that you think can never be null but sometimes is.