How can the error 'java.io.IOException: An existing connection was forcibly closed by the remote host,' be solved which may occur when attempting to connect to a database in TIBCO Data Virtualization?

How can the error 'java.io.IOException: An existing connection was forcibly closed by the remote host,' be solved which may occur when attempting to connect to a database in TIBCO Data Virtualization?

book

Article ID: KB0070292

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions.

Description

Sometimes when trying to establish a connection with a database, an error as below can be observed in the TIBCO Data Virtualization:

 ERROR [DbChannel-RequestSelectThread] 2023-07-25 08:53:30.689 +1000 ServerChannelConnection - java.io.IOException: Communication error with xx.xx.xx.xxxxx[dbchannel-1908517]     at cs.jdbc.driver.protocol.WireDecoder.processInput(WireDecoder.java:381)     at cs.jdbc.driver.protocol.ChannelConnection.processInput(ChannelConnection.java:420)     at com.compositesw.server.dbchannel.RequestSelectThread.run(RequestSelectThread.java:427)     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)     at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host     at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)     at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)     at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)     at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:245)     at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)     at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)     at cs.jdbc.driver.protocol.ChannelConnection.read(ChannelConnection.java:425)     at com.compositesw.server.dbchannel.ServerChannelConnection.read(ServerChannelConnection.java:289)     at cs.jdbc.driver.protocol.WireDecoder.processInput(WireDecoder.java:281)     ... 5 more
This error stack points towards this being a network issue. The possible reasons for it and the way to solve it is explained below.
 

Environment

All supported environments.

Resolution

This issue is when the database server is on a remote server and not on localhost. The below points don't hold in the case of localhost.

This issue could be because of 3 reasons:
1. Ensure the database port is in LISTENING state. A Telnet or Netstat from the client server can be done to check if the port is open.
2. Firewall - The IP of the database servers needs to be whitelisted.
3. Enabling the Operating System's restricted environment access - follow the below steps:
   a. Navigate to the  Control Panel
   b. Right-click on the  Java icon -> Go to  Advanced Tab
   c. Then check  Enable Operating System's restricted environment Apply and Save

User-added image

Note: For Linux, the Java control panel needs to be first enabled.

Issue/Introduction

This article explains the reason behind the mentioned issue and also outlines the way to solve it.

Additional Information

Refer: https://stackoverflow.com/questions/37787447/getting-java-io-ioexception-an-existing-connection-was-forcibly-closed-by-the