cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karel Vlcek (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-3422) 'Cannot find target method' when certain hex-encoded characters are used in @PathParam in GET requests
Date Fri, 25 Mar 2011 11:05:05 GMT
'Cannot find target method' when certain hex-encoded characters are used in @PathParam in GET
requests
------------------------------------------------------------------------------------------------------

                 Key: CXF-3422
                 URL: https://issues.apache.org/jira/browse/CXF-3422
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.3.3, 2.3.1
         Environment: Tomcat 6
            Reporter: Karel Vlcek
            Priority: Minor


I have following simple JAX-RS service:

{code}
public interface RootService {
    @Path("data1")
    public DataService getDataService();
}

public interface DataService {
    @GET
    @Path("data2/{id}")
    public Data getData(@PathParam("id") String id);
}
{code}

All works correctly as long as URL contains in position of @PathParam("id") ASCII characters
and digits or hex-encoded spaces. These URLs work:

GET /root/data1/data2/1
GET /root/data1/data2/AAA2BBB
GET /root/data1/data2/1%202

However, when URL on position of the parameter {id} contains certain hex-encoded characters
other than space (1%202), like in this URL (this example contains digit '1' followed by 'latin
capital letter d with caron'):

GET /root/data1/data2/1%C4%8E

I'll get following exception:

{noformat}
javax.ws.rs.WebApplicationException
	at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:399)
	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:204)
	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:88)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
	at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461)
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)
	at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)
{noformat}

{code}
//////////////////////////////
// Simple implementations - just to complete the example...

public class RootServiceImpl implements RootService {
    @Override
    public StaticDataService getDataService() {
        return new DataServiceImpl();
    }
}

public class DataServiceImpl implements DataService {
    @Override
    public Data getData(final String id) {
      // ...
    }
}
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message