I'm using camel 2.2.0 with spring 3.0.0 without any problems here.
Here is the relevant spring config:
<!-- Change trace to true for debugging purposes -->
<camel:camelContext id="jamesCamelContext" trace="false" >
<camel:jmxAgent id="agent" disabled="true"/>
<camel:template id="producerTemplate"/>
<camel:routeBuilder ref="processorRoute" />
</camel:camelContext>
In my pom.xml I use this:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.2.0</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
As you see I exclude spring-web. Maybe you don't exclude it and so it
pull a "old" spring version and so something get mixed..
Bye,
Norman
2010/4/8 Willem Jiang <[email protected]>:
> Can you create a JIRA with a small test case to show the error?
> We did run the test with Spring 3.0.0 before Camel 2.2.0 released.
>
> BTW, can you try the latest released Spring 3.0.2.RELEASE to check if the
> error still there?
>
> Willem
>
> umairt wrote:
>>
>> Hi,
>>
>>
>> I am trying to shift my project(currently using Camel2.2.0 and Spring 2.5)
>> to spring 3.0. I have changed the spring version to 3 but I am getting the
>> following stack trace:
>>
>> orCaused by: java.lang.NullPointerException
>> at
>> org.apache.camel.impl.ProducerCache.<init>(ProducerCache.java:52)
>> at
>>
>> org.apache.camel.impl.DefaultProducerTemplate.<init>(DefaultProducerTemplate.java:57)
>> at
>>
>> org.apache.camel.spring.CamelProducerTemplateFactoryBean.getObject(CamelProducerTemplateFactoryBean.java:74)
>> at
>>
>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
>>
>> After I debugged it I found something very strange in
>> CamelProducerTemplateFactoryBean. The getObject method is being called
>> before afterPropertiesSet method is called. That is why camel context is
>> uninitialized and hence the null pointer exception. I was wondering how
>> this
>> could happen in Spring or am I missing some camel configuration for spring
>> 3.0?
>>
>>
>> Umair
>
>