One Star

tMySQLInput and tJasperOutput on Linux : Communications link failure

Hello,
I explain you my problem.
First step : I worked on Windows. I configured the tMySQLInput to access to a database installed on a server. Then I connected tMySQLInput to the tJasperOutput component to create a PDF file based on some fields from a table of my database.
I created the jrxml file with IReport. All worked fine.
Second step : the goal is to build the job to deploy it on an Ubuntu server (the one where my database is installed).
I changed the path to "/folder/subfolder/and_so_on" and build the job. I tried to run it on my Ubuntu server but it doesn't work.
I get the folloming error message : 
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:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:356)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2502)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2539)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2321)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:832)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
        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.ConnectionImpl.getInstance(ConnectionImpl.java:417)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:344)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at test1.test5_0_1.test5.tMysqlInput_1Process(test5.java:550)
        at test1.test5_0_1.test5.runJobInTOS(test5.java:984)
        at test1.test5_0_1.test5.main(test5.java:861)
Caused by: java.net.ConnectException: Connexion terminée par expiration du délai d'attente
        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:392)
        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:258)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:306)
        ... 17 more

I did not change anything in the parameters of my connection..
Have you any ideas to make it work ? I really don't understand why the connection to my database is ok when I test the job on windows and not on linux.. I'm really stuck..
Thanks !!
Julien
5 REPLIES
Two Stars

Re: tMySQLInput and tJasperOutput on Linux : Communications link failure

Hi,
By looking at the error message, one thing is clear that it is the problem with the database communication.
You might be hard coded the database details like hostname/port/databasename/username/password.
Change the db credentials accordingly and run the job again.
-Bhanu
One Star

Re: tMySQLInput and tJasperOutput on Linux : Communications link failure

Hi,
And thank you very much for your answer.
I made some corrections and it oooks like there was a problem with the database connection.
I ran the job again and I have 2 error messages :
log4j:WARN No appenders could be found for logger (net.sf.jasperreports.engine.xml.JRXmlDigesterFactory).
log4j:WARN Please initialize the log4j system properly.

I have no error messages anymore but the PDF file is not created..
What should I do ?
Thanks !!
Julien
Two Stars

Re: tMySQLInput and tJasperOutput on Linux : Communications link failure

Hi,
Again the reason for this warning is that, the Jrxml(Jasper report) is not placed in the folder where you have mentioned the path.
Make sure that the jrxml should be there in the mentioned folder and also pass the parameters as well if required.
-Bhanu
One Star

Re: tMySQLInput and tJasperOutput on Linux : Communications link failure

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)
Two Stars

Re: tMySQLInput and tJasperOutput on Linux : Communications link failure

Hi,
The reason for this error is that the db connection is failed. It might be because of network failure or disconnection of the network.
Check whether you will be able to connect to the db or not from any other app.