dosgi: No resource methods have been found for resource class - javax.ws.rs annotation ignored?
<p>i run in an exception showed below.
I tried to publish a webservie using annotation with dosgi. But is looks like the annotations will be ignored.</p>

<p>When i use
    restProps.put("service.exported.configs", "org.apache.cxf.<strong>ws</strong>");</p>

<p>in my Activator.java Class without javax.ws.rs annotations, it works fine and i can request the wsdl (localhost:9090/provalet?wsdl).</p>

<p>Here are some related threads, but non of these answers helped me:</p>

<p><a href="https://stackoverflow.com/questions/11277918/no-resource-methods-when-using-jax-rs-on-tomee">&quot;No resource methods&quot; when using JAX-RS on TomEE+</a>
-> in considered the "public" scope</p>

<p><a href="https://stackoverflow.com/questions/6363832/cxf-dosgi-is-ignoring-annotations">CXF DOSGi is ignoring annotations</a>
<a href="http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-td4495048.html" rel="nofollow noreferrer">http://cxf.547215.n5.nabble.com/CXF-DOSGi-is-ignoring-JAX-RS-annotations-td4495048.html</a>
-> i have no bundle named "org.apache.servicemix.specs.jsr311-api-1.1"</p>

<p>i also developed this example <a href="http://maksim.sorokin.dk/it/2011/09/18/maven-apache-felix-cxf-dosgi-an-example-of-dosgi-service/" rel="nofollow noreferrer">http://maksim.sorokin.dk/it/2011/09/18/maven-apache-felix-cxf-dosgi-an-example-of-dosgi-service/</a> 
-> but same exception</p>

<p>I work with </p>

<ul>
<li>List item</li>
<li>apache felix 5.4.0</li>
<li>Distributed OSGi Distribution Software Single-Bundle Distribution (1.2.0)</li>
<li>JAVA 1.8</li>
</ul>

<p>my bundles are:</p>

<pre><code>START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (5.4.0)
    1|Active     |    1|backport-util-concurrent (3.1.0)
    2|Active     |    1|ANTLR Runtime (3.1.3)
    3|Active     |    1|Apache Commons Bean Utilities (1.8.0)
    4|Active     |    1|Apache Commons Collections (3.2.1)
    5|Active     |    1|Apache Commons Logging (1.1.1)
    6|Active     |    1|Apache Log4J (1.2.15)
    7|Active     |    1|SLF4J API (1.5.10)
    8|Resolved   |    1|SLF4J Log4J Binding (1.5.10)
    9|Active     |    1|Distributed OSGi Distribution Software Single-Bundle Distribution (1.2.0)
   10|Active     |    1|javax.ws.rs-api (2.0.1)
   11|Active     |    1|jaxb-api (2.2.7)
   12|Active     |    1|Sesame 2.1.1 onejar. (2.1.1)
   13|Active     |    1|Apache Felix Gogo Command (0.8.0)
   14|Active     |    1|Apache Felix Gogo Runtime (0.8.0)
   15|Active     |    1|Apache Felix Gogo Shell (0.8.0)
   16|Active     |    1|osgi.cmpn (4.2.0.200908310645)
   17|Active     |    1|provalet (1.0.0.SNAPSHOT)
   18|Active     |    1|Metro Web Services API OSGi Bundle (2.1.0.b16)
   19|Active     |    1|Prova compact (3.2.1)
</code></pre>

<p>Activator.java (OSGi Activator in my bundle provalet (1.0.0.SNAPSHOT)):</p>

<pre><code>public void start(BundleContext arg0) throws Exception {
    Activator.arg0 = arg0;
    System.out.println("Start Provalet...");

    Dictionary&lt;String, String&gt; restProps = new Hashtable&lt;String, String&gt;();
    restProps.put("service.exported.interfaces", "*");
    restProps.put("service.exported.configs", "org.apache.cxf.rs");
    restProps.put("service.exported.intents", "HTTP");
    restProps.put("org.apache.cxf.rs.address", "http://localhost:9090/provalet");

    arg0.registerService(ProvaletService.class.getName(), 
                                      new ProvaletServiceImpl(), restProps);
}
</code></pre>

<p>ProvaletService.java:</p>

<pre><code>import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@WebService 
public interface ProvaletService {
    public String greetMe(@WebParam(name = "greeterName") String greeterName);
    public String getMetaData();
    public String startTestProva();

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/sayhelo")
    public String sayHello();
}
</code></pre>

<p>OSGI-INF/remote-service/remote-service.xml:</p>

<pre><code>&lt;service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0"&gt;
  &lt;service-description&gt;
    &lt;provide interface="de.fuBerlin.api.ProvaletService" /&gt;
    &lt;property name="service.exported.interfaces"&gt;*&lt;/property&gt;
    &lt;property name="service.exported.configs"&gt;org.apache.cxf.rs&lt;/property&gt;
    &lt;property name="service.exported.intents"&gt;HTTP&lt;/property&gt;
    &lt;property name="org.apache.cxf.rs.address"&gt;http://localhost:9090&lt;/property&gt;
  &lt;/service-description&gt;
&lt;/service-descriptions&gt;
</code></pre>

<p>Here is the part of my pom.xml responsable for generating the bundle</p>

<pre><code>&lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                &lt;version&gt;1.2.0&lt;/version&gt;
                &lt;extensions&gt;true&lt;/extensions&gt;
                &lt;configuration&gt;
                    &lt;instructions&gt;
                        &lt;Export-Package&gt;
                            de.fuBerlin.provalet,
                            de.fuBerlin.api
                        &lt;/Export-Package&gt;
                        &lt;Import-Package&gt;
                            org.apache.cxf.dosgi.dsw.qos,
                            org.osgi.framework;version="1.5.0",
                            org.osgi.util.tracker;version="1.4.0",
                            ws.prova.api2;version="3.2.1",
                            ws.prova.exchange;version="3.2.1",
                            ws.prova.exchange.impl;version="3.2.1",
                            ws.prova.service;version="3.2.1",
                            javax.jws,
                            javax.ws.rs;version="[2.0,3)",
                            javax.ws.rs.core;version="[2.0,3)"
                        &lt;/Import-Package&gt;
                        &lt;Private-Package&gt;

                        &lt;/Private-Package&gt;
                        &lt;Bundle-SymbolicName&gt;${pom.artifactId}&lt;/Bundle-SymbolicName&gt;
                        &lt;Bundle-Activator&gt;
                            de.fuBerlin.provalet.Activator
                        &lt;/Bundle-Activator&gt;
                    &lt;/instructions&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
</code></pre>

<p>Here is the exception:</p>

<pre><code>application context:org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@4796c889: display name [OsgiBundleXmlApplicationContext(bundle=cxf-dosgi-ri-singlebundle-distribution, config=classpath:/OSGI-INF/cxf/intents/intent-map.xml)]; startup date [Tue Apr 26 10:18:40 CEST 2016]; root of context hierarchy
    retrieved intent map: IntentMap: {addressing=org.apache.cxf.ws.policy.WSPolicyFeature@667a0762, logging=org.apache.cxf.feature.LoggingFeature@353563e5, SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@171868d4, SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@171868d4, SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@59a950ae, HTTP=PROVIDED}
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
    INFO: interfaces selected for export: [de.fuBerlin.api.ProvaletService]
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
    INFO: configuration types selected for export: [org.apache.cxf.rs]
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
    INFO: creating initial ExportDescription for interface de.fuBerlin.api.ProvaletService  with configuration types [org.apache.cxf.rs]
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
    INFO: creating server for interface de.fuBerlin.api.ProvaletService
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore exportService
    INFO: found handler for de.fuBerlin.api.ProvaletService  -&gt; org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler@4c6b2597
    Apr 26, 2016 10:18:40 AM org.apache.cxf.dosgi.dsw.handlers.JaxRSPojoConfigurationTypeHandler createServer
    INFO: Creating a de.fuBerlin.api.ProvaletService endpoint via JaxRSPojoConfigurationTypeHandler, address is http://localhost:9090/provalet
    Apr 26, 2016 10:18:40 AM org.apache.cxf.jaxrs.utils.ResourceUtils checkMethodDispatcher
    WARNING: No resource methods have been found for resource class de.fuBerlin.api.ProvaletService
    Apr 26, 2016 10:18:40 AM org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean checkResources
    SEVERE: No resource classes found
    Exception in thread "pool-6-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.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    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
</code></pre>

<p>Assumption: I even think that is a problem with dependencies and it looks like the javax.ws.rs annotation will be ignored. Maybe i have a mistake with the bundle versions either.</p>

<p>Does someone know something more about this problem and how i can solve this?
Please let me know, if you need more information.</p>

<p>kind regards
lars</p>