春天上下文:
<bean id="customRouteA" class="com.xxx.CustomRouteABean" />
<camelContext id="solr" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:topic:agent" />
<to uri="bean:customRouteA"/>
</route>
</camelContext>
Java代码:
public class CustomRouteABean {
@EndpointInject(uri = "http4://localhost/camel-route-test.php")
ProducerTemplate producer;
public void processMessage(@Body String message) {
...
}
}
不断报错:
2085 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customRouteA' defined in ServletContext resource [/WEB-INF/application-context.xml]: Initialization of bean failed; nested exception is org.apache.camel.spring.GenericBeansException: Error post processing bean: customRouteA; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: http4://localhost/camel-route-test.php?bridgeEndpoint=true due to: null
我有另一个 bean 具有相同的设置工作得很好,我在这里缺少什么?