cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JAX-RS: GET request required before PUT is recognized
Date Wed, 27 Feb 2013 21:42:12 GMT
What CXF version ? This rings a bell but I'm pretty sure it has been fixed,

Cheers, Sergey
On 27/02/13 18:49, purecharger wrote:
> I have a simple JAX-RS controller exposing 2 methods, one marked @GET and one
> marked @PUT. Issuing a PUT request first to the controller after application
> startup causes a 404 response and exceptions from CXF that no method is
> matched on the controller. If I issue a GET request first, then a PUT
> request, both methods are found. Any ideas on what I'm doing wrong?
>
> public class LoggerController {
>
>      @GET
>      @Produces("application/json")
>      public Map<String,Object>  getLevel(@QueryParam(LOGGER) String logger) {
>      ...
>      }
>
>      @PUT
>      @Produces("application/json")
>      public Map<String,Object>  setLevel(@QueryParam(LOGGER) String logger,
> @QueryParam(LEVEL) String level) {
>      ...
>      }
>
> }
>
> org.apache.cxf.jaxrs.utils.JAXRSUtils - Trying to select a resource
> operation on the resource class servlet.LoggerController
> org.apache.cxf.jaxrs.utils.JAXRSUtils - No method match, method name :
> getLevel, request path : /com/ws/log, method @Path : /, HTTP Method : PUT,
> method HTTP Method : GET, ContentType : */*, method @Consumes : */*,, Accept
> : */*,, method @Produces : application/json,.
> org.apache.cxf.jaxrs.utils.JAXRSUtils - No method match, method name :
> setLevel, request path : /com/ws/log, method @Path : /, HTTP Method : PUT,
> method HTTP Method : PUT, ContentType : */*, method @Consumes : */*,, Accept
> : */*,, method @Produces : application/json,.
> org.apache.cxf.jaxrs.utils.JAXRSUtils - No operation matching request path
> "/com/ws/log" is found, Relative Path: /com/ws/log, HTTP Method: PUT,
> ContentType: */*, Accept: */*,. Please enable FINE/TRACE log level for more
> details.
>
> applicationContext.xml:
>
>      <jaxrs:server id="logger" address="/log">
>          <jaxrs:serviceBeans>
>              <bean id="loggerController" class="servlet.LoggerController"/>
>          </jaxrs:serviceBeans>
>          <jaxrs:providers>
>              <ref bean="jacksonJsonProvider" />
>          </jaxrs:providers>
>      </jaxrs:server>
>
> web.xml:
>
>    <servlet>
>      <servlet-name>CXFServlet</servlet-name>
>      <display-name>CXF Servlet</display-name>
>      <servlet-class>
>          org.apache.cxf.transport.servlet.CXFServlet
>      </servlet-class>
>      <load-on-startup>1</load-on-startup>
>    </servlet>
>    <servlet-mapping>
>      <servlet-name>CXFServlet</servlet-name>
>      <url-pattern>/ws/*</url-pattern>
>    </servlet-mapping>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-GET-request-required-before-PUT-is-recognized-tp5723847.html
> Sent from the cxf-user mailing list archive at Nabble.com.



Mime
View raw message