You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Charles Moulliard (JIRA)" <ji...@apache.org> on 2009/09/22 09:28:52 UTC

[jira] Created: (CAMEL-2033) java.io.NotSerializableException: org.apache.camel.component.jms.JmsQueueEndpoint (polling consumer with POJO)

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.


[jira] Assigned: (CAMEL-2033) java.io.NotSerializableException: org.apache.camel.component.jms.JmsQueueEndpoint (polling consumer with POJO)

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-2033:
----------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: Claus Ibsen
>
> 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.


[jira] Commented: (CAMEL-2033) java.io.NotSerializableException: org.apache.camel.component.jms.JmsQueueEndpoint (polling consumer with POJO)

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54423#action_54423 ] 

Charles Moulliard commented on CAMEL-2033:
------------------------------------------

Thx for the correction.

Top of Karaf (osgi server), we have a strange error generated when I update my camel bundle containing this route and the code of the consumer. Here is the error :

{code}
12:34:36,633 | INFO  | heduler_Worker-2 | x3s                              | rg.apache.camel.processor.Logger   88 | Exchange[
, BodyType:org.quartz.JobDetail
, Body:JobDetail 'DEFAULT.quartz://x3sReporting/clientError?cron=0+0%2F2+9-18+%3F+*+MON-FRI':  jobClass: 'org.apache.camel.component.quartz.CamelJob isStateful: false isVolatile: false isDurable: false requestsRecovers: false
, CaughtExceptionType:java.lang.IllegalStateException, CaughtExceptionMessage:Invalid BundleContext., StackTrace:java.lang.IllegalStateException: Invalid BundleContext.
	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
	at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
	at org.apache.camel.osgi.OsgiServiceRegistry.lookup(OsgiServiceRegistry.java:47)
	at org.apache.camel.osgi.CompositeRegistry.lookup(CompositeRegistry.java:59)
	at org.apache.camel.impl.DefaultCamelContext.createEndpoint(DefaultCamelContext.java:1101)
	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:408)
	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
	at org.apache.camel.impl.DefaultConsumerTemplate.resolveMandatoryEndpoint(DefaultConsumerTemplate.java:134)
	at org.apache.camel.impl.DefaultConsumerTemplate.receive(DefaultConsumerTemplate.java:53)
	at org.apache.camel.impl.DefaultConsumerTemplate.receiveBody(DefaultConsumerTemplate.java:80)
	at org.apache.camel.impl.DefaultConsumerTemplate.receiveBody(DefaultConsumerTemplate.java:107)
	at org.apache.camel.impl.DefaultConsumerTemplate.receiveBody(DefaultConsumerTemplate.java:112)
	at com.xpectis.x3s.core.util.ReportingConsumer.collectMessages(ReportingConsumer.java:29)
{code}

> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.1.0
>
>
> 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.


[jira] Resolved: (CAMEL-2033) java.io.NotSerializableException: org.apache.camel.component.jms.JmsQueueEndpoint (polling consumer with POJO)

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2033.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0

trunk: 817576.

> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.1.0
>
>
> 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.