Hi,dremio friend:
there was a small problem in dremio2.0.5 when I used the dremio jdbc .jar to execute the SQL,(the sql is right excuted in dremio UI). it got the error messages which relevent with the user logining . thanks.
I use the code to invoke the dremio-jdbc.jar
public final static String DREMIO_JDBC_URL=“jdbc:dremio:direct=node3:31010”;
public static void TestDremioJDBCDriver(){
String connStr=DREMIO_JDBC_URL;
Connection connection=null;
try {
connection= DriverManager.getConnection( connStr, null );
System.out.println(“connection=”+connection);
Statement testStatement= connection.createStatement();
boolean queryRs= testStatement.execute("select t.stationCode,t.transSmallType,t.transBigType from dsm_csp_elasticsearch.afc_event.transOutInStation t ");
System.out.println(“queryRs=”+queryRs);
throw new IllegalStateException(
“Proxy driver seems loaded already; can’t test loading.” );
}
catch ( SQLException e ) {
e.printStackTrace();
}
}
error info
java.sql.SQLException: Failure in connecting to Dremio: cdjd.com.dremio.exec.rpc.RpcException: HANDSHAKE_VALIDATION : Status: AUTH_FAILED, Error Id: beaf04a2-13f2-4446-ae05-f83a547aef3a, Error message: Invalid user credentials, user anonymous
at com.dremio.jdbc.impl.DremioConnectionImpl.(DremioConnectionImpl.java:110)
at com.dremio.jdbc.impl.DremioJdbc41Factory.newConnection(DremioJdbc41Factory.java:72)
at com.dremio.jdbc.impl.DremioFactory.newConnection(DremioFactory.java:67)
at cdjd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:143)
at com.dremio.jdbc.Driver.connect(Driver.java:70)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.lanysec.csp.dremio.DremioJdbcTest.TestDremioJDBCDriver(DremioJdbcTest.java:25)
at com.lanysec.csp.dremio.DremioJdbcTest.main(DremioJdbcTest.java:15)
Caused by: cdjd.com.dremio.exec.rpc.RpcException: HANDSHAKE_VALIDATION : Status: AUTH_FAILED, Error Id: beaf04a2-13f2-4446-ae05-f83a547aef3a, Error message: Invalid user credentials, user anonymous
at cdjd.com.dremio.exec.client.DremioClient$FutureHandler.connectionFailed(DremioClient.java:810)
at cdjd.com.dremio.sabot.rpc.user.QueryResultHandler$ChannelClosedHandler.connectionFailed(QueryResultHandler.java:385)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$HandshakeSendHandler.success(BasicClient.java:256)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$HandshakeSendHandler.success(BasicClient.java:239)
at cdjd.com.dremio.exec.rpc.RequestIdMap$RpcListener.set(RequestIdMap.java:135)
at cdjd.com.dremio.exec.rpc.BasicClient$ClientHandshakeHandler.consumeHandshake(BasicClient.java:284)
at cdjd.com.dremio.exec.rpc.AbstractHandshakeHandler.decode(AbstractHandshakeHandler.java:55)
at cdjd.com.dremio.exec.rpc.AbstractHandshakeHandler.decode(AbstractHandshakeHandler.java:27)
at cdjd.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at cdjd.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at cdjd.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at cdjd.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at cdjd.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
at cdjd.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:138)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at cdjd.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at cdjd.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:748)
Caused by: cdjd.com.dremio.exec.rpc.RpcException: Status: AUTH_FAILED, Error Id: beaf04a2-13f2-4446-ae05-f83a547aef3a, Error message: Invalid user credentials, user anonymous
at cdjd.com.dremio.sabot.rpc.user.UserClient.validateHandshake(UserClient.java:172)
at cdjd.com.dremio.sabot.rpc.user.UserClient.validateHandshake(UserClient.java:64)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$HandshakeSendHandler.success(BasicClient.java:251)
… 29 more