camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Spring does not handle @Produce
Date Thu, 05 Aug 2010 06:05:09 GMT
Hi

It ought to work.

However if Spring for whatever reason cannot post process a bean it
logs it something like bean XXX is not eligible for post processing.
So check the log.

And are you sure you got all the .jars on the classpath. Try with
log:foo instead of the AMQ endpoint.

I added an unit test which you can take a look at
http://svn.apache.org/viewvc?view=revision&revision=982480


On Wed, Aug 4, 2010 at 9:09 PM, unixployd <zheka.prog@gmail.com> wrote:
>
> I have next code:
>
> public class ProcessorProducer {
>
>        private Log log = LogFactory.getLog(getClass());
>
>        @Produce(uri="activemq:foo.bar")
>        protected ProducerTemplate producer;
>
>        public void sendMsg(){
>                log.info("producer=" + producer );
>                producer.sendBody("Hello!");
>        }
> }
>
> and applcationContext.xml
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:camel="http://camel.apache.org/schema/spring"
>        xmlns:context="http://www.springframework.org/schema/context"
>        xmlns:amq="http://activemq.apache.org/schema/core"
>        xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>       http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>       http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd">
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"/>
>
> <bean id="processorProducer" class="yyy.ProcessorProducer"/>
>
> </beans>
>
> When executing method sendMsg, I am getting NPE.
> What's wrong? it seems that Spring Post Processor doesn't handle injecting
> @Produce for the class ProcessorProducer...
> --
> View this message in context: http://camel.465427.n5.nabble.com/Spring-does-not-handle-Produce-tp2264524p2264524.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message