Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

using sqlcl and IO Error: Got minus one from a read call

user447000Feb 14 2023

Hi,

out team encountered a strange problem when using sqlcl .
"Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.10.0.0.0"
in a docker container and publish the 1521 port outside.
There was no problem to connect and work with this database with sqldeveloper from outside.
However when using sqlcl (no matter which version) we got an error:
Error Message = IO Error: Got minus one from a read call (CONNECTION_ID=Lej7SLPBRFmk8mUs/tcQQQ==)
We used the TWO_TASK environment variable on connect.
It looked like
TWO_TASK='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))(CONNECT_DATA=(SERVICE_NAME=ORCLPDB1)))'

All this worked when ‘localhost’ was replaced by IP address.

We solved the problem now by setting the ENVIRONMENT-variable
export CUSTOM_JDBC='-Doracle.net.disableOob=true'
(this variable is read by the ‘sql’ shellscript which starts the java process)

So it worked also with localhost and without IP.

It seemed also only a problem when all this - dockerized database and sqlcl client - was running inside a linux virtual machine.
I tried to reproduce the error in a native linux environment and it worked without setting CUSTOM_JDBC. (I used the same sqlcl-version and same java-version and of course the same oracle image).

Can someone explain what oracle.net.disableOob mean and why is it necessary to set the property in one environment and not necessary in another? Although I now have a workaround, I still don't really understand the problem.

Best regards
Thomas

Comments

Processing

Post Details

Added on Feb 14 2023
5 comments
5,128 views