cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Castro <apudcas...@entwash.org>
Subject Re: JAXRS: Multiple service beans problem
Date Wed, 15 Apr 2009 23:51:56 GMT
Interesting, I found a similar problem on the lists just now, but no
resolution...

http://www.mail-archive.com/users@cxf.apache.org/msg03977.html

On Wed, Apr 15, 2009 at 4:31 PM, David Castro <apudcastro@entwash.org>wrote:

> I am having an issue mapping multiple service beans. Only the first bean's
> paths seem to be mapped at all.  So something like this would not work for
> me, because only authenticate service methods would be available:
>
>   <jaxrs:server id="serviceServer" address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="authServiceImpl" />
>       <ref bean="contactServiceImpl" />
>     </jaxrs:serviceBeans>
>
> *Here are the service interfaces:*
>
> public interface AuthenticationService {
>     @GET
>     @Path("/authenticate/{uid}:{pass}")
>     public Response authenticate(@PathParam("uid") String username,
> @PathParam("pass") String password);
> }
>
> public interface ContactService {
>     @GET
>     @Path("/contacts")
>     public Contacts getContacts();
> }
>
> I can't find a solution to this other than creating an uber service
> interface that extended all the other interfaces...or potentially creating
> new jaxrs:server entries for each and every service.  Thoughts, suggestions?
>
> Not sure if it is related, but also ran into a similar problem, where when
> I have two service interfaces like below...where service A and B both have a
> common sub-path.  It seems that both /v3/authenticate and /v4/authenticate
> are available.  However, /v4/authenticate/validate is not available.  No
> sub-path for a method is available in v4 if v3 doesn't have the same path.
> If I remove the v3 bean, then both v4 methods are available.
>
> *Take the following from cxf_beans.xml where I define 2 service beans:*
>
>   <jaxrs:server id="serviceServer" address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="contactServiceImpl3" />
>       <ref bean="contactServiceImpl4" />
>     </jaxrs:serviceBeans>
>
> *Here are the service interfaces:*
>
> =====
>
> @Path("/v3")
> public interface AuthenticationService {
>     @GET
>     @Path("/authenticate/{uid}:{pass}")
>     public Response authenticate(@PathParam("uid") String username,
> @PathParam("pass") String password);
> }
>
> =====
>
> @Path("/v4")
> public interface AuthenticationService {
>     @GET
>     @Path("/authenticate/{uid}:{pass}")
>     public Response authenticate(@PathParam("uid") String username,
> @PathParam("pass") String password);
>
>     @GET
>     @Path("/authenticate/validate/{token}")
>     public Response validate(@PathParam("token") String token);
> }
>
> =====
>
>
> *The error in the logs:*
>
> 2009-04-15 22:39:51,028 ERROR [STDERR] Apr 15, 2009 10:39:51 PM
> org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
> WARNING: .No operation matching request path
> /authenticate/validate/BTaaZUycRa is found, ContentType : */*, Accept :
> application/xml
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message