我在其中一个点火群集服务器上运行查询时遇到以下错误,我使用JDBC连接点火。
查询:
public Connection connection() throws SQLException, ClassNotFoundException{
// Register JDBC driver.
Class.forName("org.apache.ignite.IgniteJdbcDriver");
// Opening a connection in the streaming mode and time based flushing set.
Connection conn = DriverManager.getConnection("jdbc:ignite://172.16.60.69:11211/");
return conn;
}
public void query() throws SQLException, ClassNotFoundException{
System.out.println("Connecting...");
Connection dbConnection= connection();
System.out.println("Connection successful");
String selectTableSQL = "select * from tableName limit 10";
System.out.println("Creating statement...");
Statement statement = dbConnection.createStatement();
System.out.println("statement created");
System.out.println("Executing query...");
ResultSet rs = statement.executeQuery(selectTableSQL);
System.out.println("Query executed");
while (rs.next()) {
String userid = rs.getString(0);
String username = rs.getString(1);
System.out.println(userid);
System.out.println(username);
}
错误:
Exception in thread "main" java.sql.SQLException: Failed to execute job due to unexpected runtime exception [jobId=c8a9f954361-04b07e2b-bfb9-4421-b310-eae03e36ac58, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcTask, dep=LocalDeployment [super=GridDeployment [ts=1525866907994, depMode=SHARED, clsLdr=org.springframework.boot.loader.LaunchedURLClassLoader@63961c42, clsLdrId=14541c44361-0a306a0b-24ea-4173-905a-27dda62f72ba, userVer=0, loc=true, sampleClsName=java.lang.String, pendingUndeploy=false, undeployed=false, usage=0]], taskClsName=org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcTask, sesId=b8a9f954361-04b07e2b-bfb9-4421-b310-eae03e36ac58, startTime=1525885528956, endTime=9223372036854775807, taskNodeId=04b07e2b-bfb9-4421-b310-eae03e36ac58, clsLdr=org.springframework.boot.loader.LaunchedURLClassLoader@63961c42, closed=false, cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false, internal=false, subjId=04b07e2b-bfb9-4421-b310-eae03e36ac58, mapFut=IgniteFuture [orig=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=679771341]], execName=null], jobId=c8a9f954361-04b07e2b-bfb9-4421-b310-eae03e36ac58]]
at org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcTask.reduce(GridCacheQueryJdbcTask.java:173)
at org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcTask.reduce(GridCacheQueryJdbcTask.java:65)
at org.apache.ignite.internal.processors.task.GridTaskWorker$6.call(GridTaskWorker.java:1113)
at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6621)
at org.apache.ignite.internal.processors.task.GridTaskWorker.reduce(GridTaskWorker.java:1111)
at org.apache.ignite.internal.processors.task.GridTaskWorker.onResponse(GridTaskWorker.java:938)
at org.apache.ignite.internal.processors.task.GridTaskProcessor.processJobExecuteResponse(GridTaskProcessor.java:1060)
at org.apache.ignite.internal.processors.task.GridTaskProcessor$JobMessageListener.onMessage(GridTaskProcessor.java:1285)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1257)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:885)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$2100(GridIoManager.java:114)
at org.apache.ignite.internal.managers.communication.GridIoManager$7.run(GridIoManager.java:802)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
无论如何都要找到此错误的根本原因?错误信息并没有多大帮助。