Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F43210FD1 for ; Wed, 19 Jun 2013 20:21:33 +0000 (UTC) Received: (qmail 65286 invoked by uid 500); 19 Jun 2013 20:21:32 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 65231 invoked by uid 500); 19 Jun 2013 20:21:32 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 65223 invoked by uid 99); 19 Jun 2013 20:21:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 20:21:32 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [64.85.173.253] (HELO server.dankulp.com) (64.85.173.253) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 20:21:27 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id E3AA018448A; Wed, 19 Jun 2013 16:20:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter-users@cxf.apache.org.TaPnKujoW2 Received: from macbook.house.dankulp.com (c-24-91-72-253.hsd1.ma.comcast.net [24.91.72.253]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id 868BB184481; Wed, 19 Jun 2013 16:20:42 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: IndexOutOfBoundsException in MessageContentsList.get() From: Daniel Kulp In-Reply-To: Date: Wed, 19 Jun 2013 16:20:41 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <38E69D69-304C-48B6-8546-C75E4FA77139@apache.org> References: To: users@cxf.apache.org, Tim Olson X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 19 parameters?!?!? Jeesh=85 I think I'd be strongly considering running = wsdl2java with the -bareMethods parameters to flip to bare mode. = Seriously, consider it. =20 We'd likely need a test case for this. When you are getting that many = parameters, there is definitely some possibilities of getting some = ordering mixed up, particularly if there is a mix of headers and = non-headers and in/outs, etc=85. Dan On Jun 17, 2013, at 8:13 PM, Tim Olson wrote: > Our CXF client consistently gets an IndexOutOfBoundsException > (java.lang.IndexOutOfBoundsException: > Index: 19, Size: 19) when handling a SOAP response which otherwise = looks > valid. We're using CXF 2.7.5 with the wsdl2java Maven plugin to = generate > client wrapper code. >=20 > The stack trace goes from > = HolderInInterceptor:69 >=20 > if (client) { > List> outHolders =3D > CastUtils.cast((List)message.getExchange() > .getOutMessage().get(CLIENT_HOLDERS)); > for (MessagePartInfo part : parts) { > if (part.getIndex() !=3D 0 && part.getTypeClass() !=3D = null) { > @SuppressWarnings("unchecked") > Holder holder =3D > (Holder)outHolders.get(part.getIndex() - 1); > if (holder !=3D null) {* > holder.value =3D inObjects.get(part);* > inObjects.put(part, holder); > } > } > } > } >=20 >=20 > to = MessageContentsList:80 >=20 > public Object get(MessagePartInfo key) { > Object o =3D *super.get(key.getIndex())*; > return o =3D=3D REMOVED_MARKER ? null : o; > } >=20 >=20 > and then > java.lang.IndexOutOfBoundsException: Index: 19, Size: 19 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at > = org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80= ) > at > = org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(Holder= InInterceptor.java:69) > ... >=20 > In other areas of the code, the MessagePartInfo indices seem to be > converted from 1-based indices to 0-based, but that's not happening = here. > Should the line in MessageContentsList be changed to * > super.get(key.getIndex()-1)*? Otherwise, I am at a loss for debugging = this > further. >=20 > Unfortunately, I can't share the WSDL or SOAP, since our partner = considers > it proprietary, but I can try to offer generic answers to any = questions. > The WSDL they give us is *massive* and not easy to boil down into a = small > test case (about 100 XSD's, many complex types). >=20 >=20 > Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: = Index: 19, > Size: 19 > at = org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:155) > *[elided]* > Caused by: java.lang.IndexOutOfBoundsException: Index: 19, Size: 19 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at > = org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80= ) > at > = org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(Holder= InInterceptor.java:69) > at > = org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha= in.java:271) > at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:800) > at > = org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon= seInternal(HTTPConduit.java:1592) > at > = org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon= se(HTTPConduit.java:1490) > at > = org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCo= nduit.java:1309) > at = org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) > at = org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622) > at > = org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInt= erceptor.handleMessage(MessageSenderInterceptor.java:62) > at > = org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha= in.java:271) > at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) > at = org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:133) > ... 10 more >=20 >=20 > Thanks for any ideas, > Tim --=20 Daniel Kulp dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com