cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-3499) URIMappingInterceptor and ArrayIndexOutOfBoundsException
Date Mon, 09 May 2011 04:40:03 GMT

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

Freeman Fang commented on CXF-3499:
-----------------------------------

Hi Ron,

Btw, you can use svn diff . > patch.txt to generate a patch file next time, this is easy
for applying the changes.

Thanks
Freeman

> URIMappingInterceptor and ArrayIndexOutOfBoundsException
> --------------------------------------------------------
>
>                 Key: CXF-3499
>                 URL: https://issues.apache.org/jira/browse/CXF-3499
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.4
>         Environment: Tomcat 6.0.23, Spring 3.0.5, CXF 2.4.1
>            Reporter: Ron Grimes
>            Assignee: Freeman Fang
>            Priority: Minor
>              Labels: interceptors
>             Fix For: 2.4.1, 2.3.5
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> URIMappingInterceptor keeps throwing:
> May 6, 2011 11:52:35 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
> WARNING: Interceptor for {http://ws.ds.soc.com/}MessageService has thrown exception,
unwinding now
> java.lang.ArrayIndexOutOfBoundsException: 1
> 	at org.apache.cxf.interceptor.URIMappingInterceptor.getQueries(URIMappingInterceptor.java:319)
> 	at org.apache.cxf.interceptor.URIMappingInterceptor.getParameters(URIMappingInterceptor.java:165)
> 	at org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:102)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
> 	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
> 	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:166)
> 	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:112)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)
> 	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:859)
> 	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:619)
> Current Code Affected:
> {code}
>         if (!StringUtils.isEmpty(query)) {            
>             List<String> parts = Arrays.asList(query.split("&"));
>             for (String part : parts) {
>                 if (part.contains("=")) {
>                     String[] keyValue = part.split("=");
>                     queries.put(keyValue[0], uriDecode(keyValue[1]));
>                 }
>             }
>             return queries;
>         }
> {code}
> Proposed Code Fix:
> {code}
>         if (!StringUtils.isEmpty(query)) { 
>             List<String> parts = Arrays.asList(query.split("&"));
>             for (String part : parts) {
>                 if (part.contains("=")) {
>                     String[] keyValue = part.split("=");
>                     if (keyValue.length >= 2) {
>                     	queries.put(keyValue[0], uriDecode(keyValue[1]));
>                     }
>                 }
>             }
>             return queries;
>         }
> {code}
> Diagnosis of Problem:
> If the value portion of the name/value pair is missing, then the keyValue length will
only be 1, and consequently there will be no index entry 1.

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

Mime
View raw message