You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Anthony Schexnaildre <ap...@gmail.com> on 2008/07/09 16:11:52 UTC

JAXRS @Path annotation oddities

Can anyone offer up some ideas as to why the first example publishes  
fine but the second does not? I have played around with trailing  
slashes (/) in the @Path and other little tweaks but I get the same  
result. I get the dreaded "No operation matching request path is  
found" with anything other than the first example. I am using trunk  
right now but I believe this was happening when using 2.1.1 also.

This works
============================

@Path("/")
@ProduceMime("application/xml")
public class UserServiceWSImpl implements UserServiceWS {

	@Autowired private UserService userService;

	@GET
	@Path("/user/template")
	@ProduceMime("application/xml")
	public Response template( ) {
		return Response.ok( userService.createInitializedUser() ).build();
	}
}

This does not work
============================

@Path("/user")
@ProduceMime("application/xml")
public class UserServiceWSImpl implements UserServiceWS {

	@Autowired private UserService userService;

	@GET
	@Path("/template")
	@ProduceMime("application/xml")
	public Response template( ) {
		return Response.ok( userService.createInitializedUser() ).build();
	}
}

Thank you,

-Anthony


Re: JAXRS @Path annotation oddities

Posted by Anthony Schexnaildre <ap...@gmail.com>.
Thanks. Maybe it is related as I do not know exactly what internals  
are causing your issue. I did see yours though in the archives. For  
the moment I have resorted to just creating one big class with all my  
endpoint definitions but that is a pain to deal with.

-Anthony

On Jul 9, 2008, at 10:47 AM, Brad wrote:

> This might be related to the problem I was having. Previously posted
> under "JAXRS custom provider selection based on media type" I think.
>
> Sergey is working on a fix so if they are related you could have a  
> fix soon.
>
> On Wed, Jul 9, 2008 at 3:11 PM, Anthony Schexnaildre <apschexn@gmail.com 
> > wrote:
>> Can anyone offer up some ideas as to why the first example  
>> publishes fine
>> but the second does not? I have played around with trailing slashes  
>> (/) in
>> the @Path and other little tweaks but I get the same result. I get  
>> the
>> dreaded "No operation matching request path is found" with anything  
>> other
>> than the first example. I am using trunk right now but I believe  
>> this was
>> happening when using 2.1.1 also.
>>
>> This works
>> ============================
>>
>> @Path("/")
>> @ProduceMime("application/xml")
>> public class UserServiceWSImpl implements UserServiceWS {
>>
>>       @Autowired private UserService userService;
>>
>>       @GET
>>       @Path("/user/template")
>>       @ProduceMime("application/xml")
>>       public Response template( ) {
>>               return Response.ok( userService.createInitializedUser()
>> ).build();
>>       }
>> }
>>
>> This does not work
>> ============================
>>
>> @Path("/user")
>> @ProduceMime("application/xml")
>> public class UserServiceWSImpl implements UserServiceWS {
>>
>>       @Autowired private UserService userService;
>>
>>       @GET
>>       @Path("/template")
>>       @ProduceMime("application/xml")
>>       public Response template( ) {
>>               return Response.ok( userService.createInitializedUser()
>> ).build();
>>       }
>> }
>>
>> Thank you,
>>
>> -Anthony
>>
>>


Re: JAXRS @Path annotation oddities

Posted by Brad <br...@javawork.co.uk>.
This might be related to the problem I was having. Previously posted
under "JAXRS custom provider selection based on media type" I think.

Sergey is working on a fix so if they are related you could have a fix soon.

On Wed, Jul 9, 2008 at 3:11 PM, Anthony Schexnaildre <ap...@gmail.com> wrote:
> Can anyone offer up some ideas as to why the first example publishes fine
> but the second does not? I have played around with trailing slashes (/) in
> the @Path and other little tweaks but I get the same result. I get the
> dreaded "No operation matching request path is found" with anything other
> than the first example. I am using trunk right now but I believe this was
> happening when using 2.1.1 also.
>
> This works
> ============================
>
> @Path("/")
> @ProduceMime("application/xml")
> public class UserServiceWSImpl implements UserServiceWS {
>
>        @Autowired private UserService userService;
>
>        @GET
>        @Path("/user/template")
>        @ProduceMime("application/xml")
>        public Response template( ) {
>                return Response.ok( userService.createInitializedUser()
> ).build();
>        }
> }
>
> This does not work
> ============================
>
> @Path("/user")
> @ProduceMime("application/xml")
> public class UserServiceWSImpl implements UserServiceWS {
>
>        @Autowired private UserService userService;
>
>        @GET
>        @Path("/template")
>        @ProduceMime("application/xml")
>        public Response template( ) {
>                return Response.ok( userService.createInitializedUser()
> ).build();
>        }
> }
>
> Thank you,
>
> -Anthony
>
>