JDBC throws java.io.CharConversionException
Sometimes the afuIndexer process unexpectedly throws a Java™ exception during document processing and indexing.
Symptoms
The following error message is logged:"afuIndexer[worker]: [12/01/19 15:00:50] Error:
An SQL error has occurred with the following reason:
[jcc][t4][1065][12306][3.63.75] Caught
java.io.CharConversionException. See attached Throwable
for details. ERRORCODE=-4220, SQLSTATE=null"If trace
is enabled or
afuIndexer is run in debug mode, the
following additional information is logged: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][3.62.57]
Caught java.io.CharConversionException.
See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
at com.ibm.db2.jcc.am.fd.a(fd.java:660)
at com.ibm.db2.jcc.am.fd.a(fd.java:60)
at com.ibm.db2.jcc.am.fd.a(fd.java:112)
at com.ibm.db2.jcc.am.ic.a(ic.java:2222)
at com.ibm.db2.jcc.am.ic.p(ic.java:519)
at com.ibm.db2.jcc.am.ic.N(ic.java:1524)
at com.ibm.db2.jcc.am.ym.e(ym.java:1147)
at com.ibm.db2.jcc.am.ym.getString(ym.java:1122)
at com.ibm.afu.ftsidx.shared.database.DbQuery.getStringResultValue(DbQuery.java:124)
at com.ibm.afu.ftsidx.shared.database.DbBaseQueryMethods.
selectForTargetItemDocumentParts(DbBaseQueryMethods.java:627)Causes
This unexpected exception is caused by a problem in the DB2® JDBC driver. The JDBC driver is part of DB2 and is used by the afuIndexer process to communicate with DB2. The exception can occur if the TIEREF value for a given item contains special characters that the JDBC driver cannot handle correctly.Resolving the problem
- Ensure that the DB2 JDBC driver that you are using is one of the following versions:
- 3.63.81
- 3.62.57 (DB2 9.5 FP 8 current customer version)
The JDBC driver that you use must address APAR IC74895 which is included in DB2 V95 FP8. If you are not using DB2 V95 FP8, ensure that you install a JCC driver that includes the fix for this APAR.
- Add the following line to the indexer configuration file for all
affected item types (all affected item_type_name.ini
files) under the [Settings] section:
*RmiJavaArguments =-Ddb2.jcc.charsetDecoderEncoder=3This internal and undocumented configuration option *RmiJavaArguments can be used to pass additional definitions to the JVM of the indexer worker processes. Using the given configuration value, the definition
db2.jcc.charsetDecoderEncoder=3is passed to all worker JVMs which prevents the exception from occurring in DB2 JDBC. - If this problem occurs during a debug session, you must also change
the scripts that launch the indexer process because in debugging mode, by
default, no new worker process is started. Therefore, the configuration setting
*RmiJavaArguments =-Ddb2.jcc.charsetDecoderEncoder=3is not effective for this mode. Change the afuIndexer script as follows:- For Windows: Edit the afuIndexer.cmd file in the
bin subdirectory of your indexer installation
directory and navigate to the following entry. This entry is on one line
in the
script.
Replace this entry with the following one. Again, this entry must be on one line; it must not contain any line breaks."%AFU_INDEXER_ROOT%\java\jre\bin\java" -Xrs -Xgcpolicy:gencon -XX:+DisableExplicitGC -Dsun.rmi.transport.tcp.readTimeout=120000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000 -cp "%AFUCLASSPATH%" com.ibm.afu.ftsidx.indexer.Main %*
Save the file."%AFU_INDEXER_ROOT%\java\jre\bin\java" -Xrs -Xgcpolicy:gencon -XX:+DisableExplicitGC -Dsun.rmi.transport.tcp.readTimeout=120000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000 -Ddb2.jcc.charsetDecoderEncoder=3 -cp "%AFUCLASSPATH%" com.ibm.afu.ftsidx.indexer.Main %* - For operating systems such as AIX® or Linux®: Edit the afuIndexer.sh
file in the bin subdirectory of your indexer
installation directory and navigate to the following entry. This entry
is on one line in the
script.
Replace this entry with the following one. Again, this entry must be on one line; it must not contain any line breaks.$AFU_INDEXER_ROOT/java/jre/bin/java $AFU_JVM_OPTION -Xrs -XX:+DisableExplicitGC -Dsun.rmi.transport.tcp.readTimeout=120000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000 -cp $AFUCLASSPATH com.ibm.afu.ftsidx.indexer.Main $*
Save the file.$AFU_INDEXER_ROOT/java/jre/bin/java $AFU_JVM_OPTION -Xrs -XX:+DisableExplicitGC -Dsun.rmi.transport.tcp.readTimeout=120000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000 -Ddb2.jcc.charsetDecoderEncoder=3 -cp $AFUCLASSPATH com.ibm.afu.ftsidx.indexer.Main $*
- For Windows: Edit the afuIndexer.cmd file in the
bin subdirectory of your indexer installation
directory and navigate to the following entry. This entry is on one line
in the
script.