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

Michael Rambichler commented on CAMEL-17492:
--------------------------------------------

[~davsclaus] i suppose so. But what change between 3.11 -> 3.12 leads to that. 
spring version is the same.

> CamelBeanPostProcessor fails if @Producer is used in EventNotifier
> ------------------------------------------------------------------
>
>                 Key: CAMEL-17492
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17492
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-spring-boot
>    Affects Versions: 3.12.0, 3.13.0, 3.14.0
>            Reporter: Michael Rambichler
>            Priority: Minor
>             Fix For: 3.15.0
>
>
> If you use a @Produce annotation in an EventNotifier Camel fails at startup.
> *Reproducable with:* Custom EventNotifier in a plain Camel + Springboot 
> Routebuilder.
> I have reproduced it with the spring boot example: 
> [https://github.com/apache/camel-spring-boot-examples/tree/main/spring-boot] 
> and added the EventNotifier below.
>  
> Fails since Camel > 3.11
>  
> Initialization of bean failed; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error post 
> processing bean: testEventNotifier; nested exception is 
> java.lang.NullPointerException
> ....
> Caused by: org.springframework.beans.factory.BeanCreationException: Error 
> post processing bean: testEventNotifier; nested exception is 
> java.lang.NullPointerException
> at 
> org.apache.camel.spring.spi.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:160)
>  ~[camel-spring-3.14.0.jar:3.14.0]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
>  ~[spring-beans-5.3.14.jar:5.3.14]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
>  ~[spring-beans-5.3.14.jar:5.3.14]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
>  ~[spring-beans-5.3.14.jar:5.3.14]
> ... 122 common frames omitted
>  
>  
> *Example*
> [https://github.com/apache/camel-spring-boot-examples/tree/main/spring-boot] 
> and added the EventNotifier below.
> {{TestEventNotifier.java}}
>  
> {{@Component}}
> {{public class TestEventNotifier extends EventNotifierSupport {}}
> {{   @Produce("stream:out")}}
> {{   TestProducer producer;}}
> {{   @Override}}
> {{   public void notify(CamelEvent event) throws Exception {}}
> {{      System.err.println(event);}}
> {{      //producer.publish("some notification");}}
> {{   }}}
> {{}}}
> {{---------------------------------------------------}}
> {{TestProducer.java:}}
> {{import org.apache.camel.InOnly;}}
> {{@InOnly}}
> {{public interface TestProducer {}}
> {{   void publish(String event);}}
> {{}}}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to