1 Reply Latest reply on Nov 26, 2012 6:04 AM by Andy Taylor

    java.io.NotSerializableException: java.util.concurrent.ThreadPoolExecutor while sending message to queue

    MUHAMMAD MASHIUR RAHMAN Newbie

      16:48:37,486 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499)) java.io.NotSerializableException: java.util.concurrent.ThreadPoolExecutor

      16:48:37,487 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)

      16:48:37,487 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,488 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,488 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,489 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,489 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,489 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,490 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,490 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,491 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)

      16:48:37,491 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.util.HashSet.writeObject(HashSet.java:284)

      16:48:37,492 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at sun.reflect.GeneratedMethodAccessor283.invoke(Unknown Source)

      16:48:37,492 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      16:48:37,493 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.lang.reflect.Method.invoke(Method.java:601)

      16:48:37,493 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)

      16:48:37,493 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)

      16:48:37,494 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,494 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,495 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,495 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,496 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,496 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,497 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,497 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,497 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,498 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,498 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,499 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,500 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,500 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,502 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

      16:48:37,502 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

      16:48:37,503 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)

      16:48:37,504 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)

      16:48:37,504 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)

      16:48:37,505 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at org.hornetq.jms.client.HornetQObjectMessage.setObject(HornetQObjectMessage.java:131)

      16:48:37,505 ERROR [stderr] (Thread-37 (HornetQ-client-global-threads-1988924499))      at org.hornetq.jms.client.HornetQSession.createObjectMessage(HornetQSession.java:169)

       

       

       

       

       

       

      I am getting above exception from my code below

      conn = mQueueFactory.createConnection();

                  Session session = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

                  MessageProducer producer = session.createProducer(mEntitNotifierQueue);

                  producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

                  ObjectMessage message = session.createObjectMessage(messageData);

                  producer.send(message);

       

       

       

      Can anyone please help how can I solve it. I got java.io.NotSerializableException earlier for other objects that I made serializble and build the code, finally I am getting this exception in jboss-as-7.1.1-Final I tried with jboss-as-7.1.3-Final as well but no luck.

      I made some classes Serializable for which I was getting NotSerializableException( I tried with both hornetq-core-2.2.13.Final and hornetq-core-2.2.21) but finally I ended up with this exception.