试图让Camel代理将常规bean公开为服务,但得到了一个异常



当调用常规bean中的方法时,我想激活一个camel路由。为了实现这一点,我试图让Camel代理按照Camel-doc的指示将常规bean公开为服务,但得到以下异常

堆栈转储=org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:ServletContext资源[/WEB-INF/applicationClientContext.xml]的xml文档中的第83行无效;嵌套异常为org.xml。ax.SAXParseException;行号:83;列编号:72;cvc复杂类型2.4.a:发现以元素"proxy"开头的无效内容。其中一个'{"h://camel.apache.org/schema/spring":redeliveryPolicyProfile,"h://camel.apaches.org/schema/spring":onException,"h:/camel.acches.org/schema/spring":onCompletion,"h//camel.ataches.org/scheme/spring":intercept,"hhttp://camel.Apaches.org/chema/spring":interceptFrom,"h://camel.apachesorg/schema/spring":interconnectSendToEndpoint,"h://camel.Acches.org/chemA/spring":restConfiguration,应为"h://camel.apache.org/schema/spring":rest,"h://camel.apachi.org/schema/spring":route}'

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

我的环境是JDK1.7上的IBMLiberty8.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>

对于任何遇到这个问题的人,我使用的解决方案是使用注释@Produce和@Consume注入端点,这基本上是秘密设置代理,但这没有任何问题,在这里记录了pojo端点注入

相关内容

最新更新