cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Goulet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4446) CXF JAX-RS can't handle spaces in the URL when used with Apache Tomcat
Date Thu, 17 Oct 2013 16:27:44 GMT

    [ https://issues.apache.org/jira/browse/CXF-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13798040#comment-13798040
] 

Martin Goulet commented on CXF-4446:
------------------------------------

I stumbled onto the same issue today and I can confirm that I am NOT using mod_jk at all in
my app. 

Here's my setup:

	@GET
	@Path( "/{value}" )
	public Response findBy(@QueryParam( "by" ) @DefaultValue( "id" ) String by, @PathParam( "value"
) String value);
	
	
	<jaxrs:server id="departmentTypeServer" address="/1.0/departments">
		<jaxrs:serviceBeans>
			<ref bean="DepartmentTypeREST" />
		</jaxrs:serviceBeans>
	...
	
So a typical invocation would be:

http://.../departments/1?by=id (where "1" is a @PathParam)

I do confirm that if I make a call with a space (for example) in the resource name, I do get
a "no service found" type of error (like previously mentioned in this thread). For example:

http://.../depart ments/
	
However, if there is a space in the value provided in the @PathParam, I do get an error saying
that the URL is not valid. For example:

http://.../departments/1 2?by=id

This yields this error:

SEVERE: Servlet.service() for servlet [default] in context with path [/CSA] threw exception
java.lang.IllegalArgumentException: Illegal character in path at index 48: http://localhost:8080/CSA/rest/1.0/departments/2
1
	at java.net.URI.create(URI.java:859)
	at org.apache.cxf.transport.servlet.BaseUrlHelper.getBaseURL(BaseUrlHelper.java:49)
	at org.apache.cxf.transport.servlet.ServletController.getBaseURL(ServletController.java:73)
	at org.apache.cxf.transport.servlet.ServletController.updateDestination(ServletController.java:82)
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:181)
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at com.sungard.web.filters.JarResourceFilter.doFilter(JarResourceFilter.java:47)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at com.sungard.framework.web.filters.PublicResourcesFilter.doFilter(PublicResourcesFilter.java:23)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at com.sungard.web.filters.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:108)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

So there seems to be something else at play here. Unless it is normal to get that kind of
error on a @PathParam (which I doubt, though). Can someone help me out?



> CXF JAX-RS can't handle spaces in the URL when used with Apache Tomcat
> ----------------------------------------------------------------------
>
>                 Key: CXF-4446
>                 URL: https://issues.apache.org/jira/browse/CXF-4446
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.6.1
>         Environment: Scientific Linux 6.1, Apache Tomcat 7.0.22, Java 1.6.0_29
>            Reporter: Andrew Rowley
>            Assignee: Sergey Beryozkin
>
> Putting an encoded space (%20) in the url gets the following exception:
> java.lang.IllegalArgumentException
> 	java.net.URI.create(URI.java:842)
> 	org.apache.cxf.transport.servlet.BaseUrlHelper.getBaseURL(BaseUrlHelper.java:49)
> 	org.apache.cxf.transport.servlet.ServletController.getBaseURL(ServletController.java:73)
> 	org.apache.cxf.transport.servlet.ServletController.updateDestination(ServletController.java:82)
> 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)
> 	org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
> 	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
> 	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	uk.ac.nactem.kalliope.security.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:85)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
> 	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
> 	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> root cause
> java.net.URISyntaxException: Illegal character in path at index 50: http://www.nactem.ac.uk/ArgoDemoTest/services/test
test
> 	java.net.URI$Parser.fail(URI.java:2809)
> 	java.net.URI$Parser.checkChars(URI.java:2982)
> 	java.net.URI$Parser.parseHierarchical(URI.java:3066)
> 	java.net.URI$Parser.parse(URI.java:3014)
> 	java.net.URI.<init>(URI.java:578)
> 	java.net.URI.create(URI.java:840)
> 	org.apache.cxf.transport.servlet.BaseUrlHelper.getBaseURL(BaseUrlHelper.java:49)
> 	org.apache.cxf.transport.servlet.ServletController.getBaseURL(ServletController.java:73)
> 	org.apache.cxf.transport.servlet.ServletController.updateDestination(ServletController.java:82)
> 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)
> 	org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
> 	org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
> 	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
> 	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	uk.ac.nactem.kalliope.security.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:85)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
> 	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
> 	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
> 	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
> 	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message