Hi,
I am using SQuirrel SQL Client to connect to a TEIID_VDB hosted outside of my network. I am able to connect to the VDB using the DriverManager.getConnection(url, "userid", "password") method. The moment I connect from office network/VPN, I get the below error messgae.
Unexpected Error occurred attempting to open an SQL connection.
class java.io.StreamCorruptedException: Unsupported version: 47
java.io.StreamCorruptedException: Unsupported version: 47
at org.teiid.netty.handler.codec.serialization.CompactObjectInputStream.readStreamHeader(CompactObjectInputStream.java:57)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:354)
at org.teiid.netty.handler.codec.serialization.CompactObjectInputStream.<init>(CompactObjectInputStream.java:48)
at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.readObjectOverride(ObjectDecoderInputStream.java:102)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:421)
at org.teiid.net.socket.OioOjbectChannelFactory$OioObjectChannel.read(OioOjbectChannelFactory.java:113)
at org.teiid.net.socket.SocketServerInstanceImpl.doHandshake(SocketServerInstanceImpl.java:124)
at org.teiid.net.socket.SocketServerInstanceImpl.connect(SocketServerInstanceImpl.java:92)
at org.teiid.net.socket.SocketServerConnectionFactory.getServerInstance(SocketServerConnectionFactory.java:263)
at org.teiid.net.socket.SocketServerConnection.connect(SocketServerConnection.java:241)
at org.teiid.net.socket.SocketServerConnection.selectServerInstance(SocketServerConnection.java:126)
at org.teiid.net.socket.SocketServerConnection.<init>(SocketServerConnection.java:92)
at org.teiid.net.socket.SocketServerConnectionFactory.getConnection(SocketServerConnectionFactory.java:302)
at org.teiid.jdbc.SocketProfile.connect(SocketProfile.java:60)
at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:103)
at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:51)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:147)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:148)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.lambda$execute$0(OpenConnectionCommand.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)</init></init></init>
Here is my SQuirrel Client Execution ENvironment Information:
SQuirreL SQL Client snapshot-20190228_2243
JAVA Version :jdk1.8.0_162 (64 Bit)
Java.class.version: 52.0
jdbc:teiid:TEIID_VDB@mms://168.128.30.240:443
SSL Mode: Enabled for anonymous access
**squirrel-sql.bat: **
start "SQuirreL SQL Client" /B "%LOCAL_JAVA%" -Xmx256m -Duser.home=%SQUIRREL_SQL_HOME% -Dsun.awt.nopixfmt=true -Dsun.java2d.noddraw=true -cp %SQUIRREL_CP% -splash:"%SQUIRREL_SQL_HOME%/icons/splash.jpg" net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
# Settings file for Teiid clients
org.teiid.ssl.trustAll=true
org.teiid.ssl.allowAnon=true
org.teiid.ssl.protocol=TLSv1
org.teiid.ssl.keyStoreType=JKS
org.teiid.sockets.maxObjectSize=1213486160
org.teiid.sockets.soTimeout=120000
org.teiid.sockets.synchronousttl=240000
org.teiid.sockets.conserveBandwidth=false
I get similar issue when I ran using Eclipse also. It seems like the teiid-client-10.2.0.jar / teiid-10.2.1-jdbc.jar is compiled using JDK 1.6 whereas my environment is on 1.8 JDK/JRE.
Sample JDBCClient.java:
String url = "jdbc:teiid:TEIID_VDB@mm://168.128.30.240:443;NoExec=ON;SHOWPLAN=OFF;FetchSize=500;partialResultsMode=true;";
//String url = "jdbc:teiid:TEIID_VDB@mms://168.128.30.240:443";
try
{
Class.forName("org.teiid.jdbc.TeiidDriver");
System.out.println("Before getting the Connection Object");
***Connection conn = DriverManager.getConnection(url, "myuserid", "Mypassword");***
System.out.println("After getting the Connection Object");
Statement statement = conn.createStatement();
//System.out.println("Before Statement Execution");
statement.execute("select cast(STUDY_ID as string) from STUDY_LIST WHERE STUDY_ID = '20140444'");
System.out.println("After Statement Execution");
statement.close();
conn.close();
I get error while getting the JDBC connection Object itself.
Please advise what is casuing the issue in the IOStream.
Please check if you can reproduce the problem with the code below.
Thanks Gerd
Driver driver = Class.forName("org.teiid.jdbc.TeiidDriver").newInstance();
Properties myProps = new Properties();
myProps.put("user", "<username>");
myProps.put("password", "<password>");
Connection con = driver.connect("<jdbcurl>", myProps)</jdbcurl></password></username>
Hi Gerd - Yes, I was able to reproduce the same error with the properties. The issue is that I get errorwhile getting the connection. Any stream writer conflict between the java.net.ssl based OutputStreamWriter and Teiid driver files?
Thanks