You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sric <sc...@funmobility.com> on 2008/09/17 00:02:59 UTC

Duplicated @path in service classes

I had a set of jax-rs services deployed using CXF2.1 (relying upon
jsr311-api-0.6.jar) using a single web-application. Some of the service
resource classes share the same @path value. This worked alright in CXF2.1.
I upgraded to CXF2.1.2 (using jsr311-api-0.8.jar) to avail the
ExceptionMapper feature in order to return http response status for 404 on
certain GET methods. The ExceptionMapper functionality works fine, however
some of the services are now throwing 'No operation matching request path'
for service requests with the duplicated path definitions. Is there a way to
run multiple service implementation classes using the same @path value?

Thanks
Sri
-- 
View this message in context: http://www.nabble.com/Duplicated-%40path-in-service-classes-tp19520472p19520472.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Duplicated @path in service classes

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

I think you may need to do it like this :

@Path("bar")
public class Resource1 {

@GET
public Response get() {}
//etc
}

@Path("bar/")
public class Resource2 {

@GET
public Response get() {}
@POST
@Path("foo")
public void post() {}
}

All requests (GET, POST, etc) ending with just /bar will be directed to Resource1, the requests which have /bar/* will be directed 
to Resource2.

Cheers, Sergey

>
> I had a set of jax-rs services deployed using CXF2.1 (relying upon
> jsr311-api-0.6.jar) using a single web-application. Some of the service
> resource classes share the same @path value. This worked alright in CXF2.1.
> I upgraded to CXF2.1.2 (using jsr311-api-0.8.jar) to avail the
> ExceptionMapper feature in order to return http response status for 404 on
> certain GET methods. The ExceptionMapper functionality works fine, however
> some of the services are now throwing 'No operation matching request path'
> for service requests with the duplicated path definitions. Is there a way to
> run multiple service implementation classes using the same @path value?
>
> Thanks
> Sri
> -- 
> View this message in context: http://www.nabble.com/Duplicated-%40path-in-service-classes-tp19520472p19520472.html
> Sent from the cxf-user mailing list archive at Nabble.com. 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland