java.io.NotSerializableException: 
org.apache.camel.component.jms.JmsQueueEndpoint (polling consumer with POJO)
--------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-2033
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2033
             Project: Apache Camel
          Issue Type: Bug
            Reporter: Charles Moulliard


The following error is generated when a POJO defined as a polling consumer try 
to consume messages from an activemq queue

CaughtExceptionType:java.io.NotSerializableException,
CaughtExceptionMessage:org.apache.camel.component.jms.JmsQueueEndpoint,
StackTrace:java.io.NotSerializableException:
org.apache.camel.component.jms.JmsQueueEndpoint
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at 
org.apache.camel.component.bean.BeanInvocation.writeExternal(BeanInvocation.java:104)
       at 
java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
       at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at 
org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:98)


Here is the code of the POJO

{code}
public class ReportingConsumer {
        
        @EndpointInject(name = "queueReportingEndpoint")
        private ConsumerTemplate consumer;
        
       @EndpointInject(name = "queueReportingEndpoint")
        private Endpoint endpoint;
        
        public List<Map<String, Object>> collectMessages() {

        List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
        List<Map<String, Object>> received = new ArrayList<Map<String, 
Object>>();
        
        received = consumer.receiveBody(endpoint, List.class);
...
{code}


Everything works fine when the POJO is designed like this :

{code}
@Consume(ref="queueToBeRead")
public List<> method(List<>) {

...

}
{code}

but in this case it is not a polling consumer

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to