java.sql.SQLException: Network error IOException: Address already in u

One Star

java.sql.SQLException: Network error IOException: Address already in u

The following issue is driving me nuts.

I have a run that walks a directory structure looking for XML files and importing them into SQL Server using the jtds driver. There are 6 of those runs. Initially I had them in a single job, doing 6 imports. I developed this on Linux against SQL Serverl 2000 which I happened to have on my machine. All fine.

Now I wanted to deploy this on a Windows 2003 Server. Installed TOS 2.2.3 (downloaded today). latest JRE, for import in SQL Server 2005 SP2. Brand new machine.

I loaded the project in TOS, set the correct directory and SQL Server connection settings and pressed run. However, this gave me continually the message below. After trying many different things, even looking at the source, I decided to give up. Guessed there was some bug in TOS where the connection wasn't closed (but the close() call is in the source however).

Split the job into 6 separate jobs and decided to call them one after another in a .bat file. If they are separate jobs, should be fine, right? But nope. Even in a .bat file that calls 6 separate jobs, got the same error message!!!

What's going on here?

It works however inside TOS: can run the jobs one after another without problems

Maybe it's a timing issue. So I added a pause statement before every job in my .bat file. If I pause for a few seconds, everything is ok, without the pause, I get that weird "Address already in use". It's perhaps a Windows/Java thing. And I hope this can be fixed. It's driving me nuts.

Exception in component tMSSqlOutput_1
java.sql.SQLException: Network error IOException: Address already in use: connect
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:372)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at nayler.import_xml_into_sql_server2.import_xml_into_sql_server2.tFileList_1Process(import_xml_into_sql_server2.java:1196)
at nayler.import_xml_into_sql_server2.import_xml_into_sql_server2.runJob(import_xml_into_sql_server2.java:5410)
at nayler.import_xml_into_sql_server2.import_xml_into_sql_server2.main(import_xml_into_sql_server2.java:5349)
Caused by: java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:289)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:250)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:297)
... 7 more

I've attached the layouts of my jobs.

Appreciate any pointers.
Employee

Re: java.sql.SQLException: Network error IOException: Address already in u

berend,

You've perferctly described the problem.
Can you report this strange behavior in our bugtracker ? We will try to investigate it.
Maybe this is a problem of the JDBC Driver used to connect to MS SQL Server, or a misconfiguration in MS SQL.
I don't really know yet.

As you have already found, you can add a tSleep after the tMSSqlOutput.
You can also use the tMsSQLConnection component.
This component will open only one connection for all your job.
You can reuse it in the tMSSQLOutput component configuration.

Thanks for your support
Regards,
One Star

Re: java.sql.SQLException: Network error IOException: Address already in u

Hi mhirt,

Logged bug. Where do you get the MSSqlConnection from? Don't see it in my list.
Employee

Re: java.sql.SQLException: Network error IOException: Address already in u

Sorry,

The tMSSqlConnection component has only been released in version 2.3.0M1

Regards,

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog