RelationalDatabase - IndexOutOfBoundsException
Joshua Brodie
josbrodie at gmail.com
Tue Jul 21 00:03:59 UTC 2020
I have a conundrum - we extract a number of values from AD (like student
number) -- and run a DB query to obtain other permissions.
Not everyone has student numbers.
Here is the conundrum -- where executing the QueryTemplate in DataConnector
'FOO', if the user does not have student number, the
'java.lang.IndexOutOfBoundsException:' is received (see below).
Would there be any recommendations on how best to avoid this? Thank you.
<resolver:DataConnector id="FOO" xsi:type="RelationalDatabase"
xmlns="urn:mace:shibboleth:2.0:resolver:dc">
<resolver:Dependency ref="studentNumber" />
<resolver:FailoverDataConnector
ref="FOO-staticfailoverconnector" />
<dc:BeanManagedConnection>OracleDataSource</dc:BeanManagedConnection>
<QueryTemplate>
<![CDATA[
select COLUMN a from TABLE
where
STUD='$studentNumber.get(0)'
]]>
</QueryTemplate>
<Column columnName="COLUMN" attributeID="VALUE" />
</resolver:DataConnector>
2020-07-20 16:28:24,859 - ERROR
[net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.TemplatedExecutableStatementBuilder:209]
- [16AE35F4FD704708D0CF2F7C4780D04C] - [] - Error running template
org.apache.velocity.exception.VelocityException: Velocity template
889f0339-526f-418e-a42b-2537db8068cc threw an exception
at
net.shibboleth.utilities.java.support.velocity.Template.merge(Template.java:238)
Caused by: org.apache.velocity.exception.MethodInvocationException:
Invocation of method 'get' in class java.util.ArrayList threw exception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at
889f0339-526f-418e-a42b-2537db8068cc[line 6, column 57]
at
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
2020-07-20 16:28:24,860 - DEBUG
[net.shibboleth.idp.attribute.resolver.impl.AttributeResolverImpl:403] -
[16AE35F4FD704708D0CF2F7C4780D04C] - [137.82.124.101] - Attribute Resolver
'ShibbolethAttributeResolver': Data connector 'FOO' failed to resolve,
invoking failover data connector 'FOO-staticfailoverconnector'. Reason for
failure:
net.shibboleth.idp.attribute.resolver.ResolutionException: Error running
template
at
net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.TemplatedExecutableStatementBuilder.getSQLQuery(TemplatedExecutableStatementBuilder.java:210)
Caused by: org.apache.velocity.exception.VelocityException: Velocity
template 889f0339-526f-418e-a42b-2537db8068cc threw an exception
at
net.shibboleth.utilities.java.support.velocity.Template.merge(Template.java:238)
Caused by: org.apache.velocity.exception.MethodInvocationException:
Invocation of method 'get' in class java.util.ArrayList threw exception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at
889f0339-526f-418e-a42b-2537db8068cc[line 3, column 32]
at
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20200720/9fed0eb8/attachment.htm>
More information about the users
mailing list