保险丝 esb. 组件:CXFRs webservice
我的网络服务有问题。
这是 POM.xml:
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- Testing & Camel Plugin -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<!-- CXF -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>2.7.0.redhat-610379</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>2.12.0.redhat-610379</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.12.0.redhat-610379</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>2.7.0.redhat-610379</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
<version>2.12.0.redhat-610379</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0-m10</version>
</dependency>
</dependencies>
这是路线:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/
blueprint/camel-blueprint.xsd">
<bean id="helloBean" class="com.mycompany.camel.blueprint.HelloBean">
<property name="say" value="Hi from Camel"/>
</bean>
<cxf:rsServer id="rsServer" address="http://localhost:9090/route"
serviceClass="com.mycompany.camel.blueprint.Testws"/>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="cxfrs:beanId:rsServer"/>
<log message="test"/>
<marshal>
<json library="Jackson"/>
</marshal>
</route>
</camelContext>
</blueprint>
这是功能:
package com.mycompany.camel.blueprint;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/")
public class Testws {
@GET
@Path("/test/{id}/{id2}")
@Produces(MediaType.APPLICATION_JSON)
public String getAssets(@PathParam("id") String id,
@PathParam("id2") String id2){
return null;
}
}
这是错误消息:
Caused by: javax.ws.rs.NotFoundException
at org.apache.cxf.jaxrs.*
AbstractJAXRSFactoryBean.checkResources
(AbstractJAXRSFactor yBean.java:322)
at 2)
... 55 more
我该如何解决这个问题?