JAX-RS OSGi doesn't support relative path from annotation
---------------------------------------------------------
Key: CXF-2718
URL: https://issues.apache.org/jira/browse/CXF-2718
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 2.2.6
Environment: Ubuntu 9
servicemix-4.2.0-fuse-01-00
Reporter: george.goodrich
I tried to use CXF JAX-RS in ServiceMix 4.2/Fuse ESB.
Somehow I had to prefix /cfx/server-address in the @Path of the resource class.
For example:
I used the following Spring bean xml
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
<jaxrs:server id="helloworldService" address="/hello">
<jaxrs:serviceBeans>
<ref bean="helloworldSvc"/>
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id="helloworldSvc" class=" com.test.HelloWorld"/>
Then I had to use /cxf/hello EXACTLY in resource class like below:
@Path("/cxf/hello")
public class EquipmentRegistryService {
@GET
@Produces("text/html")
public String getXml() {
return "<html><body><h1>Hello World!</body></h1></html>";
}
}
If I changed the path to anything else(such as @Path("/greeting")), I got http
404.
In the non-OSGi environment, I am able to use relative path in the path
annotation.
For example: if the @Path("/greeting") is used, I can use
/cxf/rest/hello/greeting to reach the resource in non-OSGi environment.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.