[ 
https://issues.apache.org/activemq/browse/CAMEL-3186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62309#action_62309
 ] 

Guillaume Nodet commented on CAMEL-3186:
----------------------------------------

This is one of the few limitations of the blueprint stuff right now, but i 
think it should be fixed.
You need to uncomment line 99 of the blueprint CamelContextFactoryBean:
{code}
@XmlElement(name = "beanPostProcessor", type = CamelBeanPostProcessor.class, 
required = false),
{code}

So you need to create the appropriate CamelBeanPostProcessor class in the 
blueprint module.
To define a processor using Aries Blueprint, you need to have the class 
implement the org.apache.aries.blueprint.BeanProcessor interface and make sure 
the associated ExtendedBeanMetadata#isProcessor() returns true (this flag needs 
to be set in the namespace handler).

When that's done, you should be able to intercept bean creation / destruction 
events from the processor and do what's needed.


> @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
>            Assignee: Willem Jiang
>         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