One Star

tSshTunnel Usage?

Hi, could someone give me an example of using tSshTunnel? I can't quite get it to work so far
I have attached my equivalent setup as screen captures (please disregard the first screen capture the delete function doesn't seem to be working for images)
My connection details in the tMysqlConnection are as though I am local to it (i.e. 192.168.1.1), the way I would normally connect to a local db in Talend.
Getting a communications error coming from my tMysqlConnection component, which is linked from the tSshTunnel with an "On Component OK" connector, which may or may not be the way to use it.
Here's the full error:
Exception in component tMysqlInput_1
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2408)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
disconnected
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at natcobidw.testingssh_0_1.TestingSSH.tMysqlInput_1Process(TestingSSH.java:652)
at natcobidw.testingssh_0_1.TestingSSH.tSshTunnel_1Process(TestingSSH.java:377)
at natcobidw.testingssh_0_1.TestingSSH.runJobInTOS(TestingSSH.java:1092)
at natcobidw.testingssh_0_1.TestingSSH.main(TestingSSH.java:957)
Caused by: java.net.ConnectException: Operation timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:259)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
... 18 more

Thanks Smiley Happy
6 REPLIES
Seventeen Stars

Re: tSshTunnel Usage?

The NullPointerException must no have it reason in the tMysqlInput component (even Talend shows us the error related to this component).
Please switch to the code view and show us the line mentioned in the stacktrace (currently line 666).
One Star

Re: tSshTunnel Usage?

Hi, yes here it is:
conn_tMysqlInput_1 = dataSources_tMysqlInput_1.get("")

Guessing this is because I clicked "Use an existing connection" option in tMysqlInput but there isn't one; sometimes getting a new error is a good thing and sometimes not Smiley Happy
Seventeen Stars

Re: tSshTunnel Usage?

Yes I see the problem. Actually the input component should complain the missing connection but it doesn't.
Add a tMysqlConnection to your job or switch off the option to use a existing connection.
One Star

Re: tSshTunnel Usage?

Hi,
Ok I tried both of these methods, i.e. entering the local connection details into the tMysqlInput component (which is what I had originally) as well as doing it through a tMysqlConnection component and selecting "Use an existing connection", and I'm still getting the same error as above
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
...This time in the tMyslConnection component
So it seems I'm either not setting the sSshTunnel or the tMysqlConnection parameters correctly (or both)
Seventeen Stars

Re: tSshTunnel Usage?

Yes, I agree with you. Could you test your tunnel (it should be able while the job is running - use a tSleep to keep it running and disable the connection + input component avoid dying).
A tunnel is usable of all users of the system, it is a kind of network adapter.
To test you MySQL tunneled connection I would install MySQL administration client.
If you succeed with it, you will have the correct connection details.
One Star

Re: tSshTunnel Usage?

Hi,
i am getting an error while inserting data into mysql after 1,78,99,434 rows.
i need to read 80 million rows.
following are the error that i got:
Exception in component tMysqlInput_1
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 968 milliseconds ago.  The last packet sent successfully to the server was 64,726,986 milliseconds ago.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4155)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:926)
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:2051)
        at com.mysql.jdbc.RowDataDynamic.nextRecord(RowDataDynamic.java:408)
        at com.mysql.jdbc.RowDataDynamic.next(RowDataDynamic.java:387)
        at com.mysql.jdbc.RowDataDynamic.close(RowDataDynamic.java:165)
        at com.mysql.jdbc.ResultSetImpl.realClose(ResultSetImpl.java:7471)
        at com.mysql.jdbc.ResultSetImpl.close(ResultSetImpl.java:918)