@EndpointInject not working in bean created by blueprint
--------------------------------------------------------

                 Key: CAMEL-3186
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3186
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-blueprint
    Affects Versions: 2.4.0
         Environment: Ubuntu Linux 10.04, Sun JDK 1.6.0_21
            Reporter: Aaron Riekenberg
         Attachments: camel-blueprint-test.tar.gz

I am attaching a small test project that uses blueprint to create a camel 
context and a bean named Producer.  This project builds an OSGi bundle that I 
am deploying in FUSE ESB 4.3.0-fuse-01-00.  The Producer bean has an 
@EndpointInject annotation on a ProducerTemplate:

        @EndpointInject(ref = "testEndpoint")
        private ProducerTemplate testEndpoint;

The Producer bean's init method sets a timer that tries to call 
testEndpoint.sendBody() once per second.  This throws a null pointer exception 
because the testEndpoint did not get injected:

07:35:31,826 | WARN  | Producer         | Producer                         | 
org.aaron.camel.Producer           51 | 118 - org.aaron.camel - 1.0.0.SNAPSHOT 
| send exception
java.lang.NullPointerException
        at 
org.aaron.camel.Producer.timerPop(Producer.java:48)[118:org.aaron.camel:1.0.0.SNAPSHOT]
        at 
org.aaron.camel.Producer.access$000(Producer.java:11)[118:org.aaron.camel:1.0.0.SNAPSHOT]
        at 
org.aaron.camel.Producer$1.run(Producer.java:29)[118:org.aaron.camel:1.0.0.SNAPSHOT]
        at java.util.TimerThread.mainLoop(Timer.java:512)[:1.6.0_21]
        at java.util.TimerThread.run(Timer.java:462)[:1.6.0_21]

This same test works perfectly if I use Spring DM to create the camel context 
and Producer bean.


-- 
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