cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject RE: Configuring JAX-RS services in container with Spring configuration file...
Date Sun, 30 May 2010 15:42:05 GMT
> -----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.


Mime
View raw message