cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "george.goodrich (JIRA)" <>
Subject [jira] Created: (CXF-2718) JAX-RS OSGi doesn't support relative path from annotation
Date Tue, 16 Mar 2010 22:49:27 GMT
JAX-RS OSGi doesn't support relative path from annotation

                 Key: CXF-2718
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.2.6
         Environment: Ubuntu 9 
            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">
            <ref bean="helloworldSvc"/>

    <bean id="helloworldSvc" class=" com.test.HelloWorld"/>

Then I had to use /cxf/hello EXACTLY in resource class like below:
public class EquipmentRegistryService {
	 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.

View raw message