You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ndjensen <nd...@gmail.com> on 2010/10/27 00:14:57 UTC

camel 2.4 with spring 2.5.6 TaskExecutor issue

Hi, we're upgrading from camel 2.2 to 2.4 but are staying with Spring 2.5.6
for the time being.  At startup of our application we receive the following
error:

Caused by: java.lang.NoSuchMethodError:
org.springframework.jms.listener.DefaultMessageListenerContainer.setTaskExecutor(Ljava/util/concurrent/Executor;)V
        at
org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:1072)
        at
org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:512)
        at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:137)
        at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:56)
        at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
        at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
        at org.apache.camel.impl.RouteService.doStart(RouteService.java:132)
        at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
        at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1328)
        at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1256)
        at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:952)
        at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
        at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
        at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:231)
        at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
        at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
        at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
        at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
        at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)


We believe we've traced it to a change in Spring 3 where Spring's
DefaultMessageListenerContainer.setTaskExecutor() parameter changed from
org.springframework.core.task.TaskExecutor to java.util.concurrent.Executor. 
The solution appears to be to recompile the camel jars against Spring 2.5.6. 
Do you provide the 2.4 release compiled against Spring 2.5.6?  If not, is
there anything specific we need to change with the build process to build
against Spring 2.5.6?
-- 
View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3237897.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by ebinsingh <eb...@VerizonWireless.com>.
Thanks a lot. It works now.

--
View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p4933214.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by Claus Ibsen <cl...@gmail.com>.
>From Camel 2.7+ onwards, Spring 3+ is required.

See release notes
http://camel.apache.org/camel-270-release.html

On Mon, Oct 24, 2011 at 5:56 PM, ebinsingh
<eb...@verizonwireless.com> wrote:
> Hi, Is this issue resolved.
>
> Please advise.
>
> I am using the following versions
> Camel: 2.8.1
> Spring: 2.5.6
>
> I am just trying to consume messeges on a queue write it on a SEDA. But I
> get the following error.
>
>                context.addRoutes(new RouteBuilder() {
>                    public void configure() {
>                        from("jms:queue:test_request_3").process(new Processor() {
>
>                                                @Override
>                                                public void process(Exchange exchange) throws Exception {
>                                                        exchange.getIn().getBody();
>                                                }
>                                        })
>                        .to("seda:test_output");
>                    }
>                });
>
> Exceptions:
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.springframework.jms.listener.DefaultMessageListenerContainer
> .setTaskExecutor(Ljava/util/concurrent/Executor;)V
>        at
> org.apache.camel.component.jms.JmsEndpoint.configureListenerContainer(JmsEndpoint.java:190)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:214)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:158)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:68)
>        at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
>        at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
>        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:124)
>        at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1843)
>        at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1771)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1556)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1448)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)
>        at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
>        at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
>        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)
>        at
> com.verizon.learn.camel.QueueToFile.createConsumer(QueueToFile.java:37)
>        at com.verizon.learn.camel.QueueToFile.main(QueueToFile.java:19)
>
>
> Thanks & regards,
> Ebe
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p4933096.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by ebinsingh <eb...@VerizonWireless.com>.
Hi, Is this issue resolved. 

Please advise.

I am using the following versions
Camel: 2.8.1
Spring: 2.5.6

I am just trying to consume messeges on a queue write it on a SEDA. But I
get the following error.

	        context.addRoutes(new RouteBuilder() {
	            public void configure() {
	            	from("jms:queue:test_request_3").process(new Processor() {
						
						@Override
						public void process(Exchange exchange) throws Exception {
							exchange.getIn().getBody();
						}
					})
	            	.to("seda:test_output");
	            }
	        });

Exceptions:
Exception in thread "main" java.lang.NoSuchMethodError:
org.springframework.jms.listener.DefaultMessageListenerContainer
.setTaskExecutor(Ljava/util/concurrent/Executor;)V
        at
org.apache.camel.component.jms.JmsEndpoint.configureListenerContainer(JmsEndpoint.java:190)
        at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:214)
        at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:158)
        at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:68)
        at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
        at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:124)
        at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1843)
        at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1771)
        at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1556)
        at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1448)
        at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)
        at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
        at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
        at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)
        at
com.verizon.learn.camel.QueueToFile.createConsumer(QueueToFile.java:37)
        at com.verizon.learn.camel.QueueToFile.main(QueueToFile.java:19)


Thanks & regards,
Ebe

--
View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p4933096.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I have created a ticket to track this bug
https://issues.apache.org/activemq/browse/CAMEL-3286

Lets see if we can get it to support both out of the box.


On Wed, Oct 27, 2010 at 5:13 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Wed, Oct 27, 2010 at 3:52 PM, ndjensen <nd...@gmail.com> wrote:
>>
>> We are using an instance of
>> org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor and setting
>> it on the JmsComponent.
>> --
>
> If you can avoid using that then it should work out of the box.
> If not you will have to compile the camel-jms against spring 2.5 yourself.
>
>
>> View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3238749.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 27, 2010 at 3:52 PM, ndjensen <nd...@gmail.com> wrote:
>
> We are using an instance of
> org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor and setting
> it on the JmsComponent.
> --

If you can avoid using that then it should work out of the box.
If not you will have to compile the camel-jms against spring 2.5 yourself.


> View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3238749.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by ndjensen <nd...@gmail.com>.
We are using an instance of
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor and setting
it on the JmsComponent.
-- 
View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3238749.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by Claus Ibsen <cl...@gmail.com>.
Are you using a custom TaskExecutor?

Have you configured the JMS component/endpoint to use a custom TaskExecutor?
I would assume if you do NOT do this then it should work as it wont
invoke that method.


On Wed, Oct 27, 2010 at 12:14 AM, ndjensen <nd...@gmail.com> wrote:
>
> Hi, we're upgrading from camel 2.2 to 2.4 but are staying with Spring 2.5.6
> for the time being.  At startup of our application we receive the following
> error:
>
> Caused by: java.lang.NoSuchMethodError:
> org.springframework.jms.listener.DefaultMessageListenerContainer.setTaskExecutor(Ljava/util/concurrent/Executor;)V
>        at
> org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:1072)
>        at
> org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:512)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:137)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:56)
>        at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>        at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
>        at org.apache.camel.impl.RouteService.doStart(RouteService.java:132)
>        at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
>        at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1328)
>        at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1256)
>        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:952)
>        at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
>        at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>        at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:231)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>        at
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>        at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>
>
> We believe we've traced it to a change in Spring 3 where Spring's
> DefaultMessageListenerContainer.setTaskExecutor() parameter changed from
> org.springframework.core.task.TaskExecutor to java.util.concurrent.Executor.
> The solution appears to be to recompile the camel jars against Spring 2.5.6.
> Do you provide the 2.4 release compiled against Spring 2.5.6?  If not, is
> there anything specific we need to change with the build process to build
> against Spring 2.5.6?
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3237897.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: camel 2.4 with spring 2.5.6 TaskExecutor issue

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah good catch. Looks like a non backward comb. change by Spring :(

The JAR is build against Spring 3.0.

You can build against Spring 2.5.6 as documented here
http://camel.apache.org/building.html



On Wed, Oct 27, 2010 at 12:14 AM, ndjensen <nd...@gmail.com> wrote:
>
> Hi, we're upgrading from camel 2.2 to 2.4 but are staying with Spring 2.5.6
> for the time being.  At startup of our application we receive the following
> error:
>
> Caused by: java.lang.NoSuchMethodError:
> org.springframework.jms.listener.DefaultMessageListenerContainer.setTaskExecutor(Ljava/util/concurrent/Executor;)V
>        at
> org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:1072)
>        at
> org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:512)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:137)
>        at
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:56)
>        at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>        at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
>        at org.apache.camel.impl.RouteService.doStart(RouteService.java:132)
>        at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
>        at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1328)
>        at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1256)
>        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:952)
>        at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
>        at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>        at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:231)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>        at
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>        at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
>
>
> We believe we've traced it to a change in Spring 3 where Spring's
> DefaultMessageListenerContainer.setTaskExecutor() parameter changed from
> org.springframework.core.task.TaskExecutor to java.util.concurrent.Executor.
> The solution appears to be to recompile the camel jars against Spring 2.5.6.
> Do you provide the 2.4 release compiled against Spring 2.5.6?  If not, is
> there anything specific we need to change with the build process to build
> against Spring 2.5.6?
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-2-4-with-spring-2-5-6-TaskExecutor-issue-tp3237897p3237897.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/