以为我对如何映射网址有所了解,但在这里没有任何运气。CXF 2.7.3
我有一个简单的休息服务,它使用 post 来消费一个字符串。它构建和部署。
我想我应该尝试点击以下网址:
http://localhost:9764/workflow-management-service/services/createWorkflow?type=media-metadata
我的 cxf-servlet.xml
<jaxrs:server id="workflowManagementServer" address="/">
我的 web.xml
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
资源类
@Path("/") 类级别
createWorkFlow 方法注解 @POST @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Consumes(MediaType.TEXT_PLAIN)
@Path("/createWorkflow")
从浏览器使用上面的 url 时记录。
[2013-05-10 13:47:28,798] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 尝试选择资源类,请求路径:/createWorkflow [2013-05-10 13:47: 28,798] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 尝试在资源类 com.dg.cvp.workflow.WorkflowManagementResource 上选择资源操作 [2013-05-10 13:47:28,799] 调试 { org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP 方法:GET,方法HTTP 方法:POST,ContentT ype:/ , 方法@Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, /;q=0.8,, 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,804] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP Method : GET, method HTTP Method : POST, ContentT ype : / , method @Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, / ;q=0.8, , 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,813] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP方法:GET,方法 HTTP 方法:POST,ContentT ype:/, 方法@Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, / ;q=0.8,, 方法@Produces : application/xml,application/json, . [2013-05-10 13:47:28,814] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP Method : GET, method HTTP Method : POST, ContentT ype : / , method @Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, /;q=0.8,, 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,816] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 尝试在资源类 com.dg.cvp.workflow.WorkflowManagementResource 上选择资源操作 [2013-05 -10 13:47:28,816] DEBUG {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP 方法:GET,方法 HTTP Method : POST, ContentT ype : / , method @Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, /;q=0.8,, 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,824] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP Method : GET, method HTTP Method : POST, ContentT ype : / , method @Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, / ;q=0.8, , 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,834] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP方法:GET,方法 HTTP 方法:POST,ContentT ype:/, 方法@Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, / ;q=0.8,, 方法@Produces : application/xml,application/json, . [2013-05-10 13:47:28,835] 调试 {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 没有方法匹配,方法名称:createWorkflow,请求路径:/createWorkflow,方法@Path:/createWorkflow,HTTP Method : GET, method HTTP Method : POST, ContentT ype : / , method @Consumes : text/plain,, Accept : text/html,application/xhtml+xml,application/xml;q=0.9, /;q=0.8,, 方法 @Produces : application/xml,application/json,. [2013-05-10 13:47:28,843] WARN {org.apache.cxf.jaxrs.utils.JAXRSUtils} - 找不到操作匹配请求路径“/workflow -management-service/services/createWorkflow”,相对路径: /createWorkflow, HTTP Method: GET, ContentType: */ , Accept: text/html,application/xhtml+xml,application/xml;q=0.9, /*;q=0.8,. 请启用 FINE/TRACE 日志级别以获取更多详细信息。[2013-05-10 13:47:28,853] 调试 {org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper} - WebApplicationException 已被捕获,状态:org.apache.cxf.jaxrs 的 405 javax.ws.rs.WebApplicationException .utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:413)
非常感谢任何帮助。