Discussion:
TDI StringIndexOutOfBoundException by Connector
(too old to reply)
Tatsiana
2017-05-12 11:20:20 UTC
Permalink
Hi all,

Will be very grateful if you could help me.
Have such a problem with TDI...
When processing AL is working, the strange error in ibmdi.log occurs:
java.lang.StringIndexOutOfBoundsException

The most strange thing is that error is handled in 'Default On Error' hook in update connector.

Do you have any idea what could be the problem?
We're using db2 jdbc connector here

_______________
Best regards,
Tatsiana
Eddie Hartman
2017-05-12 17:25:46 UTC
Permalink
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
Tatsiana
2017-05-31 11:24:40 UTC
Permalink
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
Tatsiana
2017-05-31 12:43:28 UTC
Permalink
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
Here is the full text of error:
DEBUG [server] - CTGDIS802I Getting reconnect choice for connector class = class com.ibm.di.connector.JDBCConnector, connector name = FillGroupTable, error = java.lang.StringIndexOutOfBoundsException. No matching rule found. Using default action - error.

What could be the problem here? some additional validation for unique fields by TDI?
Eddie Hartman
2017-06-01 09:27:05 UTC
Permalink
Post by Tatsiana
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
DEBUG [server] - CTGDIS802I Getting reconnect choice for connector class = class com.ibm.di.connector.JDBCConnector, connector name = FillGroupTable, error = java.lang.StringIndexOutOfBoundsException. No matching rule found. Using default action - error.
What could be the problem here? some additional validation for unique fields by TDI?
How are you mapping out the attributes to your database write, Tatsiana? If you have any multi-valued attributes coming from LDAP then you will need to script logic to handle writing all the values to the db. Otherwise, you could use a method like work.getString("attributeName") to return only the first value, as a String in this case. Or you could use work.attributeName.getValue(0) to return the actual value type of the first value.
Tatsiana
2017-06-01 10:48:31 UTC
Permalink
Post by Eddie Hartman
Post by Tatsiana
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
DEBUG [server] - CTGDIS802I Getting reconnect choice for connector class = class com.ibm.di.connector.JDBCConnector, connector name = FillGroupTable, error = java.lang.StringIndexOutOfBoundsException. No matching rule found. Using default action - error.
What could be the problem here? some additional validation for unique fields by TDI?
How are you mapping out the attributes to your database write, Tatsiana? If you have any multi-valued attributes coming from LDAP then you will need to script logic to handle writing all the values to the db. Otherwise, you could use a method like work.getString("attributeName") to return only the first value, as a String in this case. Or you could use work.attributeName.getValue(0) to return the actual value type of the first value.
I already use custom script to map out multi-value attributes from LDAP.

It seems that the exception occurs somewhere in the step of building SQL statement.
I use custom lookup here and one of the field (varchar) I use in where clause consists '{' character. Could it be the problem?

Just when I switch to default link criteria it seems that TDI handle special characters itself and it works fine.
Eddie Hartman
2017-06-01 18:54:43 UTC
Permalink
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
DEBUG [server] - CTGDIS802I Getting reconnect choice for connector class = class com.ibm.di.connector.JDBCConnector, connector name = FillGroupTable, error = java.lang.StringIndexOutOfBoundsException. No matching rule found. Using default action - error.
What could be the problem here? some additional validation for unique fields by TDI?
How are you mapping out the attributes to your database write, Tatsiana? If you have any multi-valued attributes coming from LDAP then you will need to script logic to handle writing all the values to the db. Otherwise, you could use a method like work.getString("attributeName") to return only the first value, as a String in this case. Or you could use work.attributeName.getValue(0) to return the actual value type of the first value.
I already use custom script to map out multi-value attributes from LDAP.
It seems that the exception occurs somewhere in the step of building SQL statement.
I use custom lookup here and one of the field (varchar) I use in where clause consists '{' character. Could it be the problem?
Just when I switch to default link criteria it seems that TDI handle special characters itself and it works fine.
Maybe it's a data type that is not getting marshalled to a jdbc type correctly. Dump out the conn entry in the before Add Hook (task.dumpEntry(conn)) and see what the data payload looks like. You can also turn on Detailed Log in the Connection tab of the db connector. See if it gives us more info to go on.
Tatsiana
2019-01-14 11:51:45 UTC
Permalink
Post by Eddie Hartman
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Post by Tatsiana
Post by Eddie Hartman
Post by Tatsiana
Hi all,
Will be very grateful if you could help me.
Have such a problem with TDI...
java.lang.StringIndexOutOfBoundsException
The most strange thing is that error is handled in 'Default On Error' hook in update connector.
Do you have any idea what could be the problem?
We're using db2 jdbc connector here
_______________
Best regards,
Tatsiana
What are you doing in the Attribute Map, Tatsiana? Or are you coding any Hooks? That error looks like something a snippet of script might be throwing.
I've analyzed the work of that connector for a while.
Related to this AL. The target of it is to transfer ldap object from ldif file to db2 database.
So the problem that I've mentioned earlier appears when the ldap attribute in file (object to be transferred to db2) consists '{' character in the field that is primary key in corresponding table of DB2.
DEBUG [server] - CTGDIS802I Getting reconnect choice for connector class = class com.ibm.di.connector.JDBCConnector, connector name = FillGroupTable, error = java.lang.StringIndexOutOfBoundsException. No matching rule found. Using default action - error.
What could be the problem here? some additional validation for unique fields by TDI?
How are you mapping out the attributes to your database write, Tatsiana? If you have any multi-valued attributes coming from LDAP then you will need to script logic to handle writing all the values to the db. Otherwise, you could use a method like work.getString("attributeName") to return only the first value, as a String in this case. Or you could use work.attributeName.getValue(0) to return the actual value type of the first value.
I already use custom script to map out multi-value attributes from LDAP.
It seems that the exception occurs somewhere in the step of building SQL statement.
I use custom lookup here and one of the field (varchar) I use in where clause consists '{' character. Could it be the problem?
Just when I switch to default link criteria it seems that TDI handle special characters itself and it works fine.
Maybe it's a data type that is not getting marshalled to a jdbc type correctly. Dump out the conn entry in the before Add Hook (task.dumpEntry(conn)) and see what the data payload looks like. You can also turn on Detailed Log in the Connection tab of the db connector. See if it gives us more info to go on.
Hi, just mentioned that hadn't replied.
The reason we've detected is in data special characters.
We had { sign in the attribute that were not parsed correctly while custom sql executing.

But after this symbol to be screened the problem was solved
Eddie Hartman
2019-01-14 22:20:52 UTC
Permalink
Thanks for sharing that, Tatsiana! You are correct that special characters in stuff like attribute names can cause problems in certain situations. The same is true for special characters in AL names.

/Eddie

Loading...