2

我正在使用JAX-RS 示例。此示例包含两个 RESTful Web 服务,一个带有注释,另一个没有。

我使用 maven 构建它并将其与 CXF DOSGi 单一捆绑分发一起部署到 Felix。一个没有注释的工作正常,但是另一个有注释的似乎完全被忽略了。我在日志中收到以下消息:

WARNING: No resource methods have been found for resource class org.apache.cxf.dosgi.samples.greeter.rest.GreeterService
Jun 15, 2011 10:34:17 PM org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean checkResources
SEVERE: No resource classes found
Exception in thread "pool-1-thread-1" org.apache.cxf.service.factory.ServiceConstructionException
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:122)
        at org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler.createServer(JaxRSPojoConfigurationTypeHandler.java:135)
        at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:244)
        at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:78)
        at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:71)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:71)
        at org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:40)
        at org.apache.cxf.dosgi.topologymanager.TopologyManager$2.run(TopologyManager.java:254)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: javax.ws.rs.WebApplicationException
        at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:238)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:85)
        ... 11 more
4

1 回答 1

5

问题是org.apache.servicemix.specs.jsr311-api-1.1我的包裹里有。当我删除它时,处理了 JAX-RS 注释。

UPD.:这是关于这个问题的 CXF 邮件列表中的一个线程。

于 2011-06-23T19:27:48.530 回答