You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2010/05/30 23:01:02 UTC

Re: Configuring JAX-RS services in container with Spring configuration file...

It all looks ok...Providing some more information may help. CXF &
tomcat versions, how does web.xml look like.
It does look like that the endpoint has not been actually published
successfully or may be CustomerService has not been recognized as a JAXRS
resource due to the fact JAXRS annotations are not visible for whatever
reasons

cheers, Sergey

On Sun, May 30, 2010 at 4:42 PM, KARR, DAVID (ATTSI) <dk...@att.com> wrote:

> > -----Original Message-----
> > From: chengy [mailto:chy108.2007@yahoo.com.cn]
> > Sent: Sunday, May 30, 2010 7:33 AM
> > To: users@cxf.apache.org
> > Subject: Configuring JAX-RS services in container with Spring
> > configuration file...
> >
> >
>  > I
> > followed:http://cxf.apache.org/docs/jax-rs.html#JAX-RS-
> > ConfiguringJAXRSservicesincontainerwithSpringconfigurationfile
> >
> -----------------------------------------------------------------------
> > ---------
> >  <jaxrs:server id="customerService" address="/s" >
> >     <jaxrs:serviceBeans>
> >       <ref bean="customerBean" />
> >     </jaxrs:serviceBeans>
> >   </jaxrs:server>
> >
> >   <bean id="customerBean" class="demo.jaxrs.server.CustomerService" />
> >
> >   @Path("/customerservice/")
> >   public class CustomerService {
> >
> >     @GET
> >     @Path("/customers/{id}/")
> >     public Customer getCustomer(@PathParam("id") String id) {
> >         System.out.println("----invoking getCustomer, Customer id is:
> "
> > +
> > id);
> >         long idNumber = Long.parseLong(id);
> >         Customer c = customers.get(idNumber);
> >         return c;
> >     }
> >
> -----------------------------------------------------------------------
> > ------
> >
> > tomcat start info:
> >
> -----------------------------------------------------------------------
> > ------
> > 2010-5-30 22:08:42 org.apache.cxf.endpoint.ServerImpl initDestination
> > Setting the server's publish address to be /s
> >
> -----------------------------------------------------------------------
> > ------
> > But when I execute the url
> > "http://localhost:8088/rsproject/s/customerservice/customers/123/" in
> > browser,tomcat print a warn message:
> > Can't find the request for
> > http://localhost:8088/rsproject/s/customerservice/customers/123/'s
> > Observer
>
> Try removing the trailing slash on all the path specifications.  For
> instance, '@Path("/customerservice")'.
>
> It might have been useful if you had use SoapUI to read your WADL file
> and build a test framework.  I believe you would have seen it generate
> sample urls with "//", which might have given you a clue to what the
> problem was.
>
>