4 Replies Latest reply on Sep 8, 2003 1:06 PM by nic7834

    JMS JmsSessionFactoryImpl passivation error

    nic7834 Newbie

      Hi there

      Any help on the following would be much appreciated.

      I use a session bean to post a message to a topic which is then read by a message driven bean. All is working, except when JBoss passivates my session bean it gives me this error:

      21:00:36,823 WARN [AbstractInstanceCache] failed to passivate, id=dk8x9a7o-12javax.ejb.EJBException: Could not passivate; failed to save state; CausedByException is:
      org.jboss.resource.adapter.jms.JmsSessionFactoryImpl at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:378) at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:85) at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:156) at org.jboss.ejb.plugins.AbstractInstanceCache.release(AbstractInstanceCache.java:192) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy.ageOut(LRUEnterpriseContextCachePolicy.java:274) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.kickOut(LRUEnterpriseContextCachePolicy.java:446) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:405) at java.util.TimerThread.mainLoop(Timer.java:432) at java.util.TimerThread.run(Timer.java:382)java.io.NotSerializableException: org.jboss.resource.adapter.jms.JmsSessionFactoryImpl at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1330) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1302) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:370) at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:85) at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:156) at org.jboss.ejb.plugins.AbstractInstanceCache.release(AbstractInstanceCache.java:192) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy.ageOut(LRUEnterpriseContextCachePolicy.java:274) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.kickOut(LRUEnterpriseContextCachePolicy.java:446) at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:405) at java.util.TimerThread.mainLoop(Timer.java:432) at java.util.TimerThread.run(Timer.java:382)


      The JNDI resource reference for my JMS TopicConnectionFactory:
      java:/JmsXA

      My code (exception handling removed):

      // Get reference to the topic connection factory.
      TopicConnectionFactory factory = (TopicConnectionFactory) componentEnvironment.lookup(EJB_REF_TOPIC_CONNECTION_FACTORY);

      // Get reference to the topic connection.
      TopicConnection topicConnection = factory.createTopicConnection();

      // Get reference to the topic.
      Topic topic = (Topic) componentEnvironment.lookup(EJB_REF_NOTIFICATION_TOPIC);

      // Create a session.
      TopicSession topicSession = topicConnection.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);


      // Create a publisher to the topic of interest.
      TopicPublisher topicPublisher = topicSession.createPublisher(topic);

      topicPublisher.setDeliveryMode(DeliveryMode.PERSISTENT);
      topicPublisher.setTimeToLive(0); // No expiration.

      // Create a message.
      message = topicSession.createObjectMessage(myMsg);

      // Publish the message.
      topicPublisher.publish(message);

      topicSession.close();


      I have also tried closing the TopicConnection in my ejbPassivate() method to no avail:

      // Close the topic connection.
      topicConnection.close();

      // Output from standard output debug statements
      // show that the topicConnection is closing and no
      // JMSException is being thrown.