Proxy 试图让Camel代理工作以将常规bean作为服务公开,但遇到异常

Proxy 试图让Camel代理工作以将常规bean作为服务公开,但遇到异常,proxy,apache-camel,websphere-liberty,Proxy,Apache Camel,Websphere Liberty,我想在调用常规bean中的方法时激活驼峰路由。为了实现这一点,我尝试让Camel代理按照来自的指令将常规bean公开为服务,但得到以下异常 Stack Dump=org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/applicationClientContext.xml]的xml文档中的第83行无效;嵌套异常为org.xml.sax.saxpasseep

我想在调用常规bean中的方法时激活驼峰路由。为了实现这一点,我尝试让Camel代理按照来自的指令将常规bean公开为服务,但得到以下异常

Stack Dump=org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/applicationClientContext.xml]的xml文档中的第83行无效;嵌套异常为org.xml.sax.saxpasseeption;行号:83;栏目号:72;cvc复杂类型.2.4.a:发现以元素“proxy”开头的内容无效。其中一个“{”h://camel.apache.org/schema/spring“:redeliveryPolicyProfile,“h://camel.apache.org/schema/spring”:一个例外,“h://camel.apache.org/schema/spring”:onCompletion,“h://camel.apache.org/schema/spring”:interceptFrom,“h://camel.apache.org/schema/spring”:interceptSendToEndpoint,应为“h://camel.apache.org/schema/spring”:restConfiguration,“h://camel.apache.org/schema/spring”:rest,“h://camel.apache.org/schema/spring”:route}”

我故意将http://改为h://因为网站不允许我发布更多链接

我的环境是JDK1.7上的IBMLiberty 8.5.5.4概要文件,使用Camel2.14.1和Spring4

<beans xmlns="h://www.springframework.org/schema/beans"
xmlns:xsi="h://www.w3.org/2001/XMLSchema-instance"

xmlns:ws="h://jax-ws.dev.java.net/spring/core"
xmlns:wss="h://jax-ws.dev.java.net/spring/servlet"      

xmlns:tx="h://www.springframework.org/schema/tx"
xmlns:context="h://www.springframework.org/schema/context"

xmlns:camel="h://camel.apache.org/schema/spring"

xsi:schemaLocation="h://www.springframework.org/schema/beans h://www.springframework.org/schema/beans/spring-beans-4.0.xsd
h://jax-ws.dev.java.net/spring/core h://jax-ws.java.net/spring/core.xsd 
h://jax-ws.dev.java.net/spring/servlet h://jax-ws.java.net/spring/servlet.xsd

h://www.springframework.org/schema/tx h://www.springframework.org/schema/tx/spring-tx.xsd    
h://www.springframework.org/schema/context h://www.springframework.org/schema/context/spring-context-4.0.xsd
h://camel.apache.org/schema/spring h://camel.apache.org/schema/spring/camel-spring.xsd">    

.
.
.
.

<!-- BeanImpl The bean is defined out side of the camel  -->
<bean id="mathService" class="com.adp.sbs.bean.service.MathServiceBeanImpl"/>

<camelContext trace="true" xmlns="h://camel.apache.org/schema/spring">

<!--  Creates a proxy to the direct:mathy endpoint. -->
<proxy id="mathProxy" serviceInterface="com.adp.sbs.service.IMathService" serviceUrl="direct:mathy" />

<export id="mathy" uri="direct:mathImpl" serviceRef="mathService"
                serviceInterface="com.adp.sbs.service.IMathService"/>


<route>
<from uri="direct:mathy"/>
<bean ref="mathService" method="add(*,*)"/>
<to uri="file:data/outbox/MathResult.txt"/>
</route>

.
.
.
.

对于遇到此问题的任何人,我使用的解决方案是使用注释@product和@Consume注入端点,这基本上是秘密设置代理,但这没有任何问题,如本文所述