Java sql sqlrecoverableexception io error got minus one from a read call

I'm running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.getConnection(getUrl()) and I'm not sure why. ...

I’m running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.getConnection(getUrl()) and I’m not sure why. Other applications work correctly.

To further confuse things, the error will correct itself on occasion (following next iteration of the program).

How should I approach a «Got minus one from a read call» error?

Full stack trace:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java line 44: setConn(DriverManager.getConnection(getUrl()));

Other info:

  • I thought it was a bad JDBC url, but it does work, sometimes for days on end before failing.
  • Amazon RDS is a managed instance and configuration changes may not be possible
  • I am using ojdbc6.jar for connectivity

asked Oct 29, 2013 at 13:59

Robert H's user avatar

1

The immediate cause of the problem is that the JDBC driver has attempted to read from a network Socket that has been closed by «the other end».

This could be due to a few things:

  • If the remote server has been configured (e.g. in the «SQLNET.ora» file) to not accept connections from your IP.

  • If the JDBC url is incorrect, you could be attempting to connect to something that isn’t a database.

  • If there are too many open connections to the database service, it could refuse new connections.

Given the symptoms, I think the «too many connections» scenario is the most likely. That suggests that your application is leaking connections; i.e. creating connections and then failing to (always) close them.

answered Oct 29, 2013 at 14:51

Stephen C's user avatar

Stephen CStephen C

688k94 gold badges790 silver badges1200 bronze badges

2

We faced the same issue and fixed it. Below is the reason and solution.

Problem

When the connection pool mechanism is used, the application server (in our case, it is JBOSS) creates connections according to the min-connection parameter. If you have 10 applications running, and each has a min-connection of 10, then a total of 100 sessions will be created in the database. Also, in every database, there is a max-session parameter, if your total number of connections crosses that border, then you will get Got minus one from a read call.

FYI: Use the query below to see your total number of sessions:

SELECT username, count(username) FROM v$session 
WHERE username IS NOT NULL group by username

Solution: With the help of our DBA, we increased that max-session parameter, so that all our application min-connection can accommodate.

Wild Pottok's user avatar

answered Jun 19, 2014 at 21:39

Arnab Sarkar's user avatar

1

I got this error message from using an oracle database in a docker despite the fact i had publish port to host option «-p 1521:1521». I was using jdbc url that was using ip address 127.0.0.1, i changed it to the host machine real ip address and everything worked then.

answered Oct 27, 2020 at 20:03

Pierre Nakashian's user avatar

4

I would like to augment to Stephen C’s answer, my case was on the first dot. So since we have DHCP to allocate IP addresses in the company, DHCP changed my machine’s address without of course asking neither me nor Oracle. So out of the blue oracle refused to do anything and gave the minus one dreaded exception. So if you want to workaround this once and for ever, and since TCP.INVITED_NODES of SQLNET.ora file does not accept wildcards as stated here, you can add you machine’s hostname instead of the IP address.

answered Feb 11, 2014 at 8:39

Stelios Adamantidis's user avatar

3

I had a similar issue when running Oracle 21c XE image on Docker locally when I was trying to connect to it by localhost or 127.0.0.1.

The fix was to log in into the container and modify sqlnet.ora in the following way:

echo "DISABLE_OOB=ON" >> /opt/oracle/oradata/dbconfig/XE/sqlnet.ora

and restart the container.

answered Jul 28, 2022 at 9:06

malloc4k's user avatar

malloc4kmalloc4k

1,6443 gold badges22 silver badges22 bronze badges

1

in my case, I got the same exception because the user that I configured in the app did not existed in the DB, creating the user and granting needed permissions solved the problem.

answered Nov 26, 2020 at 7:01

Rahul Gupta's user avatar

Rahul GuptaRahul Gupta

1,0092 gold badges15 silver badges26 bronze badges

Cause

oracle binary permission issue ($ORACLE_HOME/bin/oracle)

[tst19c@exa033dbadm01 bin]$ $ORACLE_HOME/bin

[tst19c@exa033dbadm01 bin]$ ls -ltr oracle

-rwxr-s—x 1 tst19c asmadmin 446528768 May 3 14:28 oracle

Action Taken

[tst19c@exa033dbadm01 bin]$ chmod 6751 oracle

[tst19c@exa033dbadm01 bin]$ ls -ltr oracle

Now

-rwsr-s—x 1 tst19c asmadmin 446528768 May 3 14:28 oracle

[tst19c@exa033dbadm01 bin]$

answered Sep 8, 2021 at 8:13

Atul Patel's user avatar

Atul PatelAtul Patel

5054 silver badges11 bronze badges

I’m running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.getConnection(getUrl()) and I’m not sure why. Other applications work correctly.

To further confuse things, the error will correct itself on occasion (following next iteration of the program).

How should I approach a «Got minus one from a read call» error?

Full stack trace:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java line 44: setConn(DriverManager.getConnection(getUrl()));

Other info:

  • I thought it was a bad JDBC url, but it does work, sometimes for days on end before failing.
  • Amazon RDS is a managed instance and configuration changes may not be possible
  • I am using ojdbc6.jar for connectivity

asked Oct 29, 2013 at 13:59

Robert H's user avatar

1

The immediate cause of the problem is that the JDBC driver has attempted to read from a network Socket that has been closed by «the other end».

This could be due to a few things:

  • If the remote server has been configured (e.g. in the «SQLNET.ora» file) to not accept connections from your IP.

  • If the JDBC url is incorrect, you could be attempting to connect to something that isn’t a database.

  • If there are too many open connections to the database service, it could refuse new connections.

Given the symptoms, I think the «too many connections» scenario is the most likely. That suggests that your application is leaking connections; i.e. creating connections and then failing to (always) close them.

answered Oct 29, 2013 at 14:51

Stephen C's user avatar

Stephen CStephen C

688k94 gold badges790 silver badges1200 bronze badges

2

We faced the same issue and fixed it. Below is the reason and solution.

Problem

When the connection pool mechanism is used, the application server (in our case, it is JBOSS) creates connections according to the min-connection parameter. If you have 10 applications running, and each has a min-connection of 10, then a total of 100 sessions will be created in the database. Also, in every database, there is a max-session parameter, if your total number of connections crosses that border, then you will get Got minus one from a read call.

FYI: Use the query below to see your total number of sessions:

SELECT username, count(username) FROM v$session 
WHERE username IS NOT NULL group by username

Solution: With the help of our DBA, we increased that max-session parameter, so that all our application min-connection can accommodate.

Wild Pottok's user avatar

answered Jun 19, 2014 at 21:39

Arnab Sarkar's user avatar

1

I got this error message from using an oracle database in a docker despite the fact i had publish port to host option «-p 1521:1521». I was using jdbc url that was using ip address 127.0.0.1, i changed it to the host machine real ip address and everything worked then.

answered Oct 27, 2020 at 20:03

Pierre Nakashian's user avatar

4

I would like to augment to Stephen C’s answer, my case was on the first dot. So since we have DHCP to allocate IP addresses in the company, DHCP changed my machine’s address without of course asking neither me nor Oracle. So out of the blue oracle refused to do anything and gave the minus one dreaded exception. So if you want to workaround this once and for ever, and since TCP.INVITED_NODES of SQLNET.ora file does not accept wildcards as stated here, you can add you machine’s hostname instead of the IP address.

answered Feb 11, 2014 at 8:39

Stelios Adamantidis's user avatar

3

I had a similar issue when running Oracle 21c XE image on Docker locally when I was trying to connect to it by localhost or 127.0.0.1.

The fix was to log in into the container and modify sqlnet.ora in the following way:

echo "DISABLE_OOB=ON" >> /opt/oracle/oradata/dbconfig/XE/sqlnet.ora

and restart the container.

answered Jul 28, 2022 at 9:06

malloc4k's user avatar

malloc4kmalloc4k

1,6443 gold badges22 silver badges22 bronze badges

1

in my case, I got the same exception because the user that I configured in the app did not existed in the DB, creating the user and granting needed permissions solved the problem.

answered Nov 26, 2020 at 7:01

Rahul Gupta's user avatar

Rahul GuptaRahul Gupta

1,0092 gold badges15 silver badges26 bronze badges

Cause

oracle binary permission issue ($ORACLE_HOME/bin/oracle)

[tst19c@exa033dbadm01 bin]$ $ORACLE_HOME/bin

[tst19c@exa033dbadm01 bin]$ ls -ltr oracle

-rwxr-s—x 1 tst19c asmadmin 446528768 May 3 14:28 oracle

Action Taken

[tst19c@exa033dbadm01 bin]$ chmod 6751 oracle

[tst19c@exa033dbadm01 bin]$ ls -ltr oracle

Now

-rwsr-s—x 1 tst19c asmadmin 446528768 May 3 14:28 oracle

[tst19c@exa033dbadm01 bin]$

answered Sep 8, 2021 at 8:13

Atul Patel's user avatar

Atul PatelAtul Patel

5054 silver badges11 bronze badges

I am very new with Oracle, I have installed 11g 64 bit on my Windows 10. And only started the oracle database using emctl start dbconsole. I have the following code to be connected to my database, which results in the shown exception. I have investigated a lot about this issue on web/stackoverflow/youtube etc, and could not find a straightforward working procedure, would you What is the problem? Please note that the exception happens at the following line:

con = DriverManager.getConnection(url, props);

The code looks like:

    String url = "jdbc:oracle:thin:@localhost:1158:searchengine";

    //properties for creating connection to Oracle database
    Properties props = new Properties();
    props.setProperty("user", "sys");
    props.setProperty("password", "1234");

    //creating connection to Oracle database using JDBC
    try
        {
            //Class.forName("oracle.jdbc.OracleDriver");
            con = DriverManager.getConnection(url, props);
            //con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1158:searchengine", "system", "1234");
            String query = "alter session set nls_calendar='Persian'";
            PreparedStatement pr = con.prepareStatement(query);
            pr.execute();
            query = "select sysdate from dual";
            pr = con.prepareStatement(query);
            ResultSet res = pr.executeQuery();
            while (res.next())
                {
                    System.out.println(res.toString());
                }
        }
    catch (Exception e)
        {
            e.printStackTrace();
            return false;
        }

    java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at Controllers.DBController.connect(DBController.java:24)
    at Wrapper.TestMain.start(TestMain.java:21)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Thread.java:745)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)

Posted by FatDBA on September 3, 2020

Hi Guys,

Would like to discuss one problem that I was facing today in on one of the Oracle 12c Release 1 standalone database where application team started explaining the problem that they are getting when doing application restart, specially oracle NET exception of ‘Got minus one from a read call


Caused by: java.lang.RuntimeException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/ProdMonkeyPD
    Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/ProdMonkeyPD
    Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/jdbc/ProdMonkeyPD
    Caused by: javax.resource.ResourceException: IJ031084: Unable to create connection
    Caused by: java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    Caused by: oracle.net.ns.NetException: Got minus one from a read call"}}
 

They were suspecting the issue with the high number of opened files on OS. The files count was too high when listing using lsof command on this RHEL7 system and the count goes down once the services are stopped. well I was able to explain the difference that exists between RHEL6 & RHEL7 when doing count using lsof. It was in RHEL7/EL7 that shows output including TID as default compared to RHEL6/OL6. Hence the number of open files count increases in RHEL7 as compared to RHEL6. So, it has nothing to do with the error that they have reported.

So, next we have checked database alert log and it was all good, all clean, no errors nothing. I immediately checked the value of “OS_AUTHENT_PREFIX” parameter as it specifies a prefix that Oracle uses to authenticate users attempting to connect to the system. Oracle simply appends this value to the beginning of user’s operating system account name and password and which it later on compares. So, it was set to its default value that is OPS$ and was set for the backward compatibility with previous versions.

So, I have two solutions for the problem

– Set “OS_AUTHENT_PREFIX” to “” (a null string), thereby eliminating the addition of any prefix to operating system account names.
– Set “tcp.validnode_checking = no” in SQLNET.ora file
This is to enable and disable valid node checking for incoming connections. If this parameter is set to yes, then incoming connections are allowed only if they originate from a node that conforms to list specified by TCP.INVITED_NODES or TCP.EXCLUDED_NODES parameters.

So, I tried with the first option and rebooted the database to make changes persistent (this parameter is static) and asked application team to give it a try again, and as expected it worked. The error or the ORACLE NET exception ‘Got minus one from a read call‘ was resolved after applying the first fix itself.

Here the second option is valid too as that also does the same thing, but one fix at a time.

Hope It Helps
Prashant Dixit

This entry was posted on September 3, 2020 at 1:07 PM and is filed under Advanced, troubleshooting.
Tagged: oracle, troubleshooting. You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

Я запускаю Oracle 11GR2 на экземпляре RDS Amazon. иногда я получаю IO Error: Got minus one from a read call при вызове DriverManager.getConnection(getUrl()), и я не уверен, почему. Другие приложения работают правильно.

Чтобы еще больше запутать вещи, ошибка будет исправляться сама по себе (после следующей итерации программы).

Как мне подойти к ошибке «Получена минус одна из ошибки чтения»?

Полная трассировка стека:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java строка 44: setConn(DriverManager.getConnection(getUrl()));

Дополнительная информация:

  • Я думал, что это плохой URL-адрес JDBC, но он работает, иногда в течение нескольких дней подряд, перед сбоем.
  • Amazon RDS — управляемый экземпляр, и изменения конфигурации могут быть невозможны.
  • Я использую ojdbc6.jar для подключения

29 окт. 2013, в 14:28

Поделиться

Источник

3 ответа

Непосредственная причина проблемы заключается в том, что драйвер JDBC попытался прочитать из сетевой розетки, которая была закрыта «другим концом».

Это может быть связано с несколькими вещами:

  • Если удаленный сервер настроен (например, в файле «SQLNET.ora» ), чтобы не принимать соединения с вашего IP-адреса.

  • Если URL-адрес JDBC неверен, вы можете попытаться подключиться к тому, что не является базой данных.

  • Если слишком много открытых подключений к службе базы данных, это может отказать в новых подключениях.

Учитывая симптомы, я думаю, что сценарий «слишком много соединений» наиболее вероятен. Это говорит о том, что ваше приложение является утечкой соединений; т.е. создавать соединения, а затем не закрывать их.

Stephen C
29 окт. 2013, в 15:06

Поделиться

Мы столкнулись с той же проблемой и исправлены. Ниже приведена причина и решение.

Проблема

Когда мы создаем соединение с базой данных через механизм пула соединений, тогда сервер приложений (в нашем случае это JBOSS) создает соединение, как указано в параметре min-connection. Если у вас 10 приложений, и у каждого есть мин-соединение как 10, тогда в базе данных будет создано 100 сеансов. Также в каждой базе данных есть параметр max-session, если ваше общее соединение пересекает эту границу, чем вы получите «Получил минус один из прочитанного вызова»,
FYI: используйте нижеприведенный запрос для просмотра общей сессии

SELECT username, count(username) FROM v$session 
WHERE username IS NOT NULL group by username

Решение. С помощью нашего администратора баз данных мы увеличили таковую максимальную сессию, чтобы можно было использовать все наше приложение min-connection.

Arnab Sarkar
19 июнь 2014, в 22:54

Поделиться

Я хотел бы добавить к Стивену С ответ, мое дело было на первой точке. Поэтому, поскольку у нас есть DHCP для распределения IP-адресов в компании, DHCP изменил мой машинный адрес, не спрашивая ни меня, ни Oracle. Таким образом, из синего оракула отказался что-то сделать и дал минус одно страшное исключение. Поэтому, если вы хотите обходить это раз и навсегда, и поскольку TCP.INVITED_NODES файла SQLNET.ora не принимает подстановочные знаки, как указано здесь, вы может добавить имя хоста машины вместо IP-адреса.

Stelios Adamantidis
11 фев. 2014, в 08:44

Поделиться

Ещё вопросы

  • 0Как удалить элементы и массив по двум атрибутам в AngularJS?
  • 0Безопасно ли запрашивать мою базу данных для каждой загрузки страницы?
  • 1автоматический журнал исключений Java
  • 0Напишите этот HTML из этого результата JSON (разбор JSON)
  • 1Производительность JToken.FromObject против поведения по умолчанию в Json.net
  • 0Javascript — цикл 3 функции с задержкой между каждой функцией
  • 1Создание TODO для базового лагеря возвращает 403 запрещенных (restsharp, asp.net mvc, basecamp api)
  • 1Android ==> отключить многозадачность?
  • 1GeckoFX — альтернатива для элемента управления WebBrowser «RaiseEvent» или «InvokeMember»
  • 0xslt concat текстовая строка до и после <newline /> [duplicate]
  • 1SimpleCursorTreeAdapter — Как настроить дочерний макет
  • 0AngularJS: формат ввода даты
  • 1Тестирование кармы — это виртуальная машина
  • 1Разбор XML-файла в Android
  • 0angularjs приращения повторения в условии if
  • 0jQuery Deferreds — последовательный вызов массива Deferreds
  • 1Самостоятельная ошибка при запуске локальной команды с fabric2
  • 1Понимание списка — объединение n-го элемента из каждого подсписка
  • 0Как получить значение Loaction, присутствующее в заголовке ответа в Angular Js?
  • 1Проблема с циклом for при повторении последних 5 объектов в обратном порядке
  • 1Ошибка при подключении к Estimote Beacon iOS
  • 0Sub SQL Query для сбора различных логинов
  • 0Асинхронная обработка данных внутри углового контроллера
  • 0Разрыв строки после ключевого слова return в функции jQuery
  • 1Отображение XML на модели, когда имя узла списка и имя узла элемента совпадают
  • 1Как создать com-объект для конкретной версии приложения, используя python comtypes.client?
  • 0ЕСЛИ столбец существует ОБНОВЛЕНИЕ еще ДОБАВИТЬ столбец
  • 1Конвертируйте необработанный TwoTuple в TwoTuple <A, B> неправильно, но не получили никаких предупреждений (Java Generics)
  • 0Установить cookie при нажатии кнопки 6 раз и отключить нажатие
  • 0Поиск по вложенному массиву, возврат только значения URL из одного столбца
  • 0Как избежать одиночных кавычек в ng-init
  • 0Spring Boot на Google Cloud SQL — org.hibernate.HibernateException: доступ к DialectResolutionInfo не может быть нулевым, если не задано значение hibernate.dialect
  • 0Камера расширения не найдена — PhoneGap 3.0
  • 1Неповторимые цвета на многострочных графиках с использованием matplotlib
  • 0Как обновить jQuery в drupal7
  • 1python SDK для диалогового потока: как разобрать DetectIntentResponse
  • 1Как открыть всплывающее окно Combo Box в javafx
  • 0Как Пропустить все символы из строки после появления конкретного символа
  • 0Выберите строки на основе количества других строк
  • 1Создание плавающего, редактируемого и прокручиваемого списка в Android
  • 1Печать узла на нескольких страницах
  • 1Как загрузить изображение из Google и переименовать изображение одновременно с ключевыми словами в google-images-download
  • 0PHP — ISS и неверные заголовки аутентификации
  • 1Наследование потоков — класс B расширяет A, несовместимый с A
  • 0Посчитайте биты, установленные в 1, для двоичного числа в C ++
  • 0Подтверждение: Введено — целое число? QT c ++
  • 1Как узнать длину аудиозаписи в Android
  • 0Php конвертировать секунды в читаемый формат только с необходимыми значениями
  • 0Проверка подлинности AngularJS и Rails
  • 0Обработчик событий JavaScript на дочерних элементах

Сообщество Overcoder

Posted By: Anonymous

I’m running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.getConnection(getUrl()) and I’m not sure why. Other applications work correctly.

To further confuse things, the error will correct itself on occasion (following next iteration of the program).

How should I approach a “Got minus one from a read call” error?

Full stack trace:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java line 44: setConn(DriverManager.getConnection(getUrl()));

Other info:

  • I thought it was a bad JDBC url, but it does work, sometimes for days on end before failing.
  • Amazon RDS is a managed instance and configuration changes may not be possible
  • I am using ojdbc6.jar for connectivity

Solution

The immediate cause of the problem is that the JDBC driver has attempted to read from a network Socket that has been closed by “the other end”.

This could be due to a few things:

  • If the remote server has been configured (e.g. in the “SQLNET.ora” file) to not accept connections from your IP.

  • If the JDBC url is incorrect, you could be attempting to connect to something that isn’t a database.

  • If there are too many open connections to the database service, it could refuse new connections.

Given the symptoms, I think the “too many connections” scenario is the most likely. That suggests that your application is leaking connections; i.e. creating connections and then failing to (always) close them.

Answered By: Anonymous

Related Articles

  • Problems Installing CRA & NextJS from NPM (Error:…
  • SQLException: No suitable Driver Found for…
  • ORA-12516, TNS:listener could not find available handler
  • Logging best practices
  • useEffect Error: Minified React error #321 (GTM…
  • java.sql.SQLException: Access denied for user…
  • com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:…
  • Some way to back up and delete an RDS instance, then restore…
  • What is the actual use of…
  • How does PHP ‘foreach’ actually work?

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Понравилась статья? Поделить с друзьями:
  • Java sql sqlexception network error ioexception socket failed eacces permission denied
  • Java sql sqlexception cannot get a connection pool error timeout waiting for idle object
  • Java socket connect error
  • Java security signatureexception invalid file sign как исправить
  • Java security invalidkeyexception ioexception der input integer tag error