grouper-dev - RE: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163
Subject: Grouper Developers Forum
List archive
RE: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163
Chronological Thread
- From: Chris Hyzer <>
- To: Colin Hudler <>, "" <>
- Subject: RE: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163
- Date: Wed, 3 Mar 2010 14:24:30 -0500
- Accept-language: en-US
- Acceptlanguage: en-US
Great, thanks so much for figuring that one out. Not sure how it hasn't
cause a problem already. I put this fix in 1.5.2, built the subject jar, put
it in grouper, tagged, and did a build on the build server.
https://bugs.internet2.edu/jira/browse/MCO-26
Regards,
Chris
-----Original Message-----
From: Colin Hudler
[mailto:]
Sent: Wednesday, March 03, 2010 1:45 PM
To:
Subject: Re: [grouper-dev] REST group member list results in
java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163
Replying to self..
I can confirm that changing
set.add(strings[i+2])
to:
set.add(strings[i+1])
in subject.jar fixes it.
Colin Hudler wrote:
> Hiya,
>
> I am testing grouper 1.5.2 webservice. I noticed that when doing a
> REST query like
> .../servicesRest/v1_5_002/groups/uc:apps:boe:irf:users/members I get an
> exception when it looks up the members, but only when I have a non-empty
> ws.subject.result.attribute.names in grouper-ws.properties, and at least
> one unresolvable subject in the group.
>
> I had some time, so I dug a bit. I hope this helps. Here is an
> abbreviated stack trace.
>
> groupFindResult=SUCCESS],
> edu.internet2.middleware.grouper.exception.GrouperException:
> java.lang.ArrayIndexOutOfBoundsException: 2
> at
> edu.internet2.middleware.grouper.subj.LazySubject.getName(LazySubject.java:163)
>
>
> at
> edu.internet2.middleware.grouper.ws.soap.WsSubject.assignSubjectData(WsSubject.java:222)
>
>
> <snip...>
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
>
>
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
> at
> edu.internet2.middleware.subject.provider.SubjectImpl.toAttributeMap(SubjectImpl.java:42)
>
>
> at
> edu.internet2.middleware.grouper.subj.LazySubject.getSubject(LazySubject.java:214)
>
>
> at
> edu.internet2.middleware.grouper.subj.LazySubject.getName(LazySubject.java:161)
>
>
> ... 31
>
> This ONLY happens if a member of the group is unresolvable. It only
> happens in our 1.5.x development systems; the problem is not present in
> 1.4.x. I found some stuff that changed, which seems relevant, in
> LazySubject.getSubject():
>
> //there was an error, note, dont return an error for every
> attribute...
> this.subject = new
> SubjectImpl(LazySubject.this.member.getSubjectId(), error[0],
> error[0],
> this.getTypeName(), this.getSourceId(),
> SubjectImpl.toAttributeMap("error", error[0]));
> }
>
> Here it calls SubjectImlp.toAttributeMap with two strings, so lets look
> at toAttributeMap():
>
> SubjectImpl.toAttributeMap(String... strings) {
> <snip>
> for (int i=0;i<strings.length;i+=2) {
> Set<String> set = new LinkedHashSet<String>();
> set.add(strings[i+2]); <----- EXCEPTION IS RAISED
> map.put(strings[i], set);
> }
>
> I have pointed out the section that appears to be at fault. The array
> does not have enough members to do set.add(strings[i+2]). Alternatively,
> we do have a custom subject provider, so I might have screwed something
> else up :-p
>
- REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163, Colin Hudler, 03/03/2010
- Re: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163, Colin Hudler, 03/03/2010
- RE: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163, Chris Hyzer, 03/03/2010
- Re: [grouper-dev] REST group member list results in java.lang.ArrayIndexOutOfBoundsException: 2 LazySubject.java:163, Colin Hudler, 03/03/2010
Archive powered by MHonArc 2.6.16.