camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Pocock <dan...@pocock.pro>
Subject Re: @PropertyInject throws exception
Date Fri, 05 Dec 2014 11:43:01 GMT
On 04/11/14 14:10, arnoldmad wrote:
> Hi !
>
> I'm using Camel 2.12.1 and I have an issue using the @PropertyInject
> annotation like this:
>
> private @PropertyInject(value = "node") String node

<snip>
> 	<bean id="properties"
> class="org.apache.camel.component.properties.PropertiesComponent">
> 		<property name="location" value="file:${user.home}/mybean.properties"/>
> 	</bean>
>
> When I try to get the value "node" from the PropertiesComponent using the
> annotation I get the following error:


I see the same exception with Camel 2.14.0

When I annotate a field I get the exception.

If I annotate a setter method the method is never called.

Did you ever find a solution?

In my case, the bean is a RouteBuilder extending SpringRouteBuilder




> Caused by: org.apache.camel.spring.GenericBeansException: Error post
> processing bean: cassandra; nested exception is
> org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
>         at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:154)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1475)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
>         ... 56 more
> Caused by: org.apache.camel.RuntimeCamelException:
> java.lang.NullPointerException
>         at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
>         at
> org.apache.camel.impl.CamelPostProcessorHelper.getInjectionPropertyValue(CamelPostProcessorHelper.java:250)
>         at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectFieldProperty(DefaultCamelBeanPostProcessor.java:195)
>         at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor$1.doWith(DefaultCamelBeanPostProcessor.java:171)
>         at
> org.apache.camel.util.ReflectionHelper.doWithFields(ReflectionHelper.java:73)
>         at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.injectFields(DefaultCamelBeanPostProcessor.java:167)
>         at
> org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:81)
>         at
> org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:148)
>         ... 59 more
> Caused by: java.lang.NullPointerException
>         at java.lang.String.contains(String.java:2076)
>         at
> org.apache.camel.impl.CamelPostProcessorHelper.getInjectionPropertyValue(CamelPostProcessorHelper.java:229)
>         ... 65 more
>
> anyone can help me on that issue ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/PropertyInject-throws-exception-tp5758503.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Mime
View raw message