CXF DOSGi忽略注释 [英] CXF DOSGi is ignoring annotations

查看:150
本文介绍了CXF DOSGi忽略注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using an JAX-RS example. This example contains two RESTful webservices, one with annotations and another without.

我使用Maven进行构建,并将其与CXF DOSGi单捆绑包分发一起部署到Felix中.一个没有注释的文件可以正常工作,但是另一个带有注释的文件似乎根本被忽略了.我在日志中收到以下消息:

I build it with maven and deploy it into Felix, together with CXF DOSGi single bundle distribution. The one without annotations works fine, however the other with annotations seems to be ignored at all. I get the following message in the log:

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

推荐答案

问题是我的捆绑包中有org.apache.servicemix.specs.jsr311-api-1.1.当我删除它时,JAX-RS批注已处理.

The problem was that I had org.apache.servicemix.specs.jsr311-api-1.1 in my bundles. When I removed it, JAX-RS annotations were processed.

UPD .:这是有关此问题的CXF邮件列表上的主题.

这篇关于CXF DOSGi忽略注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆