我很难找到一个简单的cxf:rsServer来监听端口 我的appContext:
<bean id="transformer" class="com.xyxx.portlistener.services.Transformer">
</bean>
<cxf:rsServer id="pushServer"
address="tcp://localhost:9090/hrm/hrm_push?bindingStyle=SimpleConsumer;resourceClasses=com.xyxx.portlistener.services.Transformer" >
<cxf:serviceBeans>
<ref bean="transformer" />
</cxf:serviceBeans>
</cxf:rsServer>
<!-- Camel Configuration -->
<camel:camelContext id="camel-1" xmlns="http://camel.apache.org/schema/spring">
<package>com.xyxx.portlistener.services</package>
<camel:route id="route1">
<camel:from uri="cxfrs://bean://pushServer"/>
<camel:to uri="log:TEST?showAll=true" />
</camel:route>
</camel:camelContext>
我的例外:
MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
我的骆驼版2.4.0 pom.xml:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hl7</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mina</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel.version}</version>
</dependency>
3个令人困惑的HTTP问题和该异常
问题:In most of the xml examples regarding cxf:rsServer我见过jaxrs:服务器已配置。这是我没有的一件事。我需要它吗? 谢谢阅读。欢迎提出所有建议。
安德鲁
答案 0 :(得分:3)
示例中显示的jaxrs:server
模拟远程REST Web服务以完成路由示例。
CXF RS客户端需要在某处发送消息,这是在不同端口上运行的JAX RS服务器所用的。
由于上面的路由目的地是其他东西(日志组件),因此您不需要JAX RS服务器配置。