我正在查询有关 Apache Tomcat 中的骆驼 cxf-rs 端点实现的问题。
我在骆驼中实现了一个 cxf-rs 端点来执行一个功能。我所做的基本上是创建从 cxf-rs 端点到 bean 的路由,该 bean 是具有某些功能的 Java 类。
因此,在点击 cxf-rs 端点 url 时,我的类中的代码将被执行。
我的代码看起来像这样,端点是,
<cxf:rsServer id="rsServer" address="http://localhost:8080/integration/services/rest"
serviceClass="com........BeginFunction"/>
开始函数.java:
@Path("/mapper/")
public class BeginFunction {
@Context
private UriInfo uriInfo;
public BeginFunction() {
}
@GET
public Response getMapper() {
return Response.status(200).entity("getMapper is called").build();
}
}
路线如下:
<route streamCache="true">
<from uri="cxfrs:bean:rsServer" />
<to uri="myBean"/>
</route>
现在,只有当我包含 jetty-jars 时,该实现似乎才能在 Tomcat 中正常工作!我担心的是我不想在 tomcat 中有另一个容器。那么有什么方法可以在不包括码头罐子的情况下在 Tomcat 中实现端点。
我目前正在运行骆驼 2.11.1、Apache Tomcat 7 和 Jetty-bundles-repository-7.6.12.v20130726。
谢谢。