jre-1.8_66で実行しているときにJTDSで奇妙なArrayIndexOutOfBoundsExceptionが発生しましたが、Web上でこの問題の他の言及が見つかりませんでした。jtds ArrayIndexOutOfBoundsException on Jre 1.8.66
サーバーjvmdllを使用しているときに、jre-1.8_66の32ビット版を実行しているときに、jtds 1.2.5と1.2.8の両方を使用してこのエラーを再現できました。 64ビットJREまたは32ビットクライアントjvm.dllを使用している場合、エラーを再現することができません。
Eclipseで実行しているときやEclipseからリモートデバッグしようとしているときにエラーを全く複製できないため、問題の特定の原因を絞り込むことができません。
完全なスタックトレースは以下のとおりです。
java.lang.ArrayIndexOutOfBoundsException: 14
at net.sourceforge.jtds.jdbc.TdsData.readData(TdsData.java:800)
at net.sourceforge.jtds.jdbc.TdsCore.tdsRowToken(TdsCore.java:3081)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2346)
at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:777)
at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:596)
at test.jtdstest.JtdsText.main(JtdsText.java:51)
私は、例外が発生すると、私は特にそれに何かを見ることができないが、私は簡単に誤解される可能性の点でJTDSコードをしました。
エラーを複製するために作成したテストプログラムは以下のとおりです。
package test.jtdstest;
import java.io.File;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Properties;
public class JtdsText
{
private static PrintWriter pw;
static
{
try
{
pw = new PrintWriter(new File("c:\\temp\\jtds_trace.txt"));
DriverManager.setLogWriter(pw);
Class.forName("net.sourceforge.jtds.jdbc.Driver");
}
catch (Exception localException)
{
}
}
public static void main(String[] args)
throws Exception
{
Connection conn = null;
PreparedStatement stmt = null;
ResultSet res = null;
try
{
String sql =
"SELECT "
+ "text1, "
+ "int1, "
+ "int2, "
+ "text2 "
+ "FROM "
+ "text_test";
conn = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/test;user=user1;password=aa");
stmt = conn.prepareStatement(sql);
res = stmt.executeQuery();
while (res.next())
{
int int1 = res.getInt(2);
System.out.println("int1 = " + Integer.toString(int1));
}
}
catch (Exception ex)
{
System.out.println("Error processing result set:");
ex.printStackTrace();
System.out.println();
}
finally
{
try
{
if(res != null)
{
res.close();
}
if(stmt != null)
{
stmt.close();
}
if(conn != null)
{
conn.close();
}
}
catch (Exception ex)
{
System.out.println("Error cleaning up Statement:");
ex.printStackTrace();
System.out.println();
}
}
}
}
エラーを複製するために使用したデータも必要に応じて提供できます。
JREのバグであると強く思われます。これは、エラーを複製できる唯一の変数です。
誰もがこれまでに遭遇したことがありますか? JVMを変更する以外に、エラーを克服する他の方法はありますか? JVMに対してこのバグを報告するべきですか?
このためにOracleバグIDへのリンクが必要ですか? – Jason