2 Replies Latest reply on Jul 1, 2004 10:47 AM by fljmayer

    NullPointerException in org.jboss.mx.loading.LoadMgr3

    fljmayer

      I want to use the org.jboss.varia.scheduler.Scheduler to ping clients via JMS to see if they are still alive. I am using JBoss 3.2.3 because if have problems with 3.2.5. Unfortunately there is a problem when I try to get the object from the JMS message returned by the client. The object is just a java.lang.Long, but it seems that the parameter repository passed to LoadMgr3.beginLoadTask() is null, leading to the exception below.


      16:36:48,203 ERROR [Scheduler$Listener] Handling a Scheduler call failed
      java.lang.NullPointerException
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:119)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at org.jboss.util.Classes.loadClass(Classes.java:357)
      at org.jboss.util.Classes.loadClass(Classes.java:296)
      at org.jboss.mq.SpyObjectMessage$1$ObjectInputStreamExt.resolveClass(SpyObjectMessage.java:99)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at org.jboss.mq.SpyObjectMessage.getObject(SpyObjectMessage.java:103)
      at com.ichg.capsela.framework.util.ObjectMessageListener.receiveObject(ObjectMessageListener.java:31)
      at com.ichg.capsela.framework.util.TopicCommunicator.receiveObjectMessage(TopicCommunicator.java:119)
      at com.ichg.capsela.ejb.ClientSessionBean.isAlive(ClientSessionBean.java:224)
      at com.ichg.capsela.ejb.ClientSessionBean.removeDeadBeans(ClientSessionBean.java:142)
      at com.ichg.capsela.jmx.IsAliveSchedulable.perform(IsAliveSchedulable.java:25)
      at org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.java:1263)
      at org.jboss.mx.server.NotificationListenerProxy.handleNotification(NotificationListenerProxy.java:69)
      at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:95)
      at javax.management.timer.Timer.sendNotifications(Timer.java:441)
      at javax.management.timer.Timer.access$000(Timer.java:31)
      at javax.management.timer.Timer$RegisteredNotification.doRun(Timer.java:612)
      at org.jboss.mx.util.SchedulableRunnable.run(SchedulableRunnable.java:164)
      at org.jboss.mx.util.ThreadPool$Worker.run(ThreadPool.java:225)


        • 1. Re: NullPointerException in org.jboss.mx.loading.LoadMgr3
          cbuckley

          Can you let me know a little more about what you trying to do. JMS ping clients (how icmp requests?), I would be very interested and willing to help you out. I just need some more fax. Oh yeah this should probably be in another forum too.

          • 2. Re: NullPointerException in org.jboss.mx.loading.LoadMgr3
            fljmayer

            Here is the scenario:
            I have a stateful session bean called ClientSessionBean, its interface is ClientSession. Every client who logs into the system does so by acquiring this bean and calling the login() method, which returns a unique session id. On the client side, there is a class called ClientSessionProxy, which implements the ClientSession interface and also wraps the proxy received from ClientSessionHome.create(). When the client calls the login() method on ClientSessionProxy, the call is delegated to the wrapped proxy; if that remote call succeeds, the ClientSessionProxy creates a JMS MessageListener on a clientIsAlive topic with a message selector that filters out everything but messages for this particular session id by looking at the the message attribute 'sessionID'.
            All the scheduler does is to send messages on the clientIsAlive topic to all logged in sessions by setting the message attribute 'sessionID'. If there is no reply within 500 milliseconds, server-internal resources related to that session are released.
            The problem happens when a reply from the client it received: when I call ObjectMessage.getObject(), I get the NullPointerException, even though the object is just a java.lang.Long containing the session id.

            Which forum would you suggest for this one?