camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unixployd <zheka.p...@gmail.com>
Subject Spring does not handle @Produce
Date Wed, 04 Aug 2010 19:09:20 GMT

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.

Mime
View raw message