camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAMEL-8253) CXFRS Throws IndexOutOfBoundsException for Empty Headers
Date Sat, 17 Jan 2015 05:33:34 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-8253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Willem Jiang reassigned CAMEL-8253:
-----------------------------------

    Assignee: Willem Jiang

> CXFRS Throws IndexOutOfBoundsException for Empty Headers
> --------------------------------------------------------
>
>                 Key: CAMEL-8253
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8253
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.14.1
>            Reporter: Vincent Furlanetto
>            Assignee: Willem Jiang
>
> Getting an IndexOutOfBoundsException when empty HTTP request headers are passed to a
camelrs web method calls (See stack trace below).
> The culprit appears to be related to the check on line 284 of class DefaultCxfRsBinding.java.
 
> More specifically here:
> ((List)entry.getValue()).get(0)
> Internally the ArrayList class will perform a range check and if the index is greater
than or equal to the size of the list the IndexOutOfBoundsException is thrown.  
> So we probably want to add an additional check before this one, something like:
> ((List)entry.getValue()).size() == 0  before the check above, since we probably want
to account for empty lists.
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> 	at java.util.ArrayList.rangeCheck(ArrayList.java:604) ~[na:1.7.0_25]
> 	at java.util.ArrayList.get(ArrayList.java:382) ~[na:1.7.0_25]
> 	at org.apache.camel.component.cxf.jaxrs.DefaultCxfRsBinding.copyProtocolHeader(DefaultCxfRsBinding.java:284)
~[camel-cxf-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.cxf.jaxrs.DefaultCxfRsBinding.populateExchangeFromCxfRsRequest(DefaultCxfRsBinding.java:116)
~[camel-cxf-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.syncInvoke(CxfRsInvoker.java:123)
~[camel-cxf-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:59)
~[camel-cxf-2.14.1.jar:2.14.1]
> 	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97) ~[cxf-core-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200) [cxf-rt-frontend-jaxrs-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) [cxf-rt-frontend-jaxrs-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
~[cxf-core-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
~[cxf-core-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
~[cxf-core-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
~[cxf-core-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:214)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:575) ~[geronimo-servlet_3.0_spec-1.0.jar:1.0]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)
~[cxf-rt-transports-http-3.0.2.jar:3.0.2]
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696) ~[jetty-servlet-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1568)
~[jetty-servlet-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
~[spring-security-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
> 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
> 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1548)
~[jetty-servlet-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524) ~[jetty-servlet-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568) ~[jetty-security-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453) ~[jetty-servlet-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.Server.handle(Server.java:459) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:280) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) ~[jetty-server-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) ~[jetty-io-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
~[jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) ~[jetty-util-9.1.0.v20131115.jar:9.1.0.v20131115]
> 	at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message