Thread: connection reset and I/O error

connection reset and I/O error

From
"mpr"
Date:
Hi,

I'm working on an application using PostgreSQL 8.0.3 via Hibernate
2.1.6 in a JBoss 4.0.1 Appserver, with both appserver and
postgres db running on the same machine with Windows XP SP2.

I get the following errors in JBoss' log, does anyone know the problem
and a solution? And yes, I already googled a lot for this problem.
I use the postgresql-8.0-311.jdbc3.jar jdbc driver.


Thanks a lot!



--snip from the stacktrace--
20:38:40,335 WARN  [JBossManagedConnectionPool] Unable to fill pool
org.jboss.resource.JBossResourceException: Could not create connection;
- nested throwable: (org.postgresql.util.PSQLExc
eption: Der Verbindungsversuch schlug fehl.)
        at
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConne
ctionFactory.java:161)
        at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalMana
gedConnectionPool.java:508)
        at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.ja
va:455)
        at
org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:70)
        at java.lang.Thread.run(Thread.java:534)
Caused by: org.postgresql.util.PSQLException: Der Verbindungsversuch
schlug fehl.
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
        at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
        at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
        at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at
org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
        at org.postgresql.Driver.connect(Driver.java:235)
        at
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConne
ctionFactory.java:151)
        ... 4 more
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at
java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at
java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:241)
        at
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:253)
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:94)
        ... 10 more
20:38:56,909 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState:
08006
20:38:56,909 ERROR [JDBCExceptionReporter] Eingabe/Ausgabe-Fehler {0}
beim Senden an das Backend.
20:38:56,940 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState:
08006
20:38:56,940 ERROR [JDBCExceptionReporter] Eingabe/Ausgabe-Fehler {0}
beim Senden an das Backend.
20:38:56,940 ERROR [JDBCExceptionReporter] Could not execute query
org.postgresql.util.PSQLException: Eingabe/Ausgabe-Fehler {0} beim
Senden an das Backend.
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:201)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
        at
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at
net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
        at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
        at
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
        at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
        at
net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
        at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
        at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
        [...]
Caused by: java.net.SocketException: Connection reset by peer: socket
write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at
java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
        at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
        at org.postgresql.core.PGStream.flush(PGStream.java:494)
        at
org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:631)
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:174)
        ... 56 more
20:38:57,643 ERROR [HibernateQuery] Could not execute query
net.sf.hibernate.JDBCException: Could not execute query
        at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1547)
        at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
        [...]
Caused by: org.postgresql.util.PSQLException: Eingabe/Ausgabe-Fehler
{0} beim Senden an das Backend.
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:201)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
        at
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
        at
net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
        at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
        at
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
        at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
        at
net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
        at
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
        ... 44 more
Caused by: java.net.SocketException: Connection reset by peer: socket
write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at
java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
        at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
        at org.postgresql.core.PGStream.flush(PGStream.java:494)
        at
org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:631)
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:174)
        ... 56 more
20:38:57,643 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState:
08006
--snip from the stacktrace--


Re: connection reset and I/O error

From
Rob Kirkbride
Date:
mpr wrote:

>Hi,
>
>I'm working on an application using PostgreSQL 8.0.3 via Hibernate
>2.1.6 in a JBoss 4.0.1 Appserver, with both appserver and
>postgres db running on the same machine with Windows XP SP2.
>
>I get the following errors in JBoss' log, does anyone know the problem
>and a solution? And yes, I already googled a lot for this problem.
>I use the postgresql-8.0-311.jdbc3.jar jdbc driver.
>
>
>Thanks a lot!
>
>
>
>--snip from the stacktrace--
>20:38:40,335 WARN  [JBossManagedConnectionPool] Unable to fill pool
>org.jboss.resource.JBossResourceException: Could not create connection;
>
>

<snipped>

I haven't seen that error, all I can say is I'm using the same
techonologies, postgres jar and version on both Linux and Windows XP SP2
but using JBoss 4.0.2 and not seen the problem. It may be worth an
upgrade. JBoss tend to release early in my opinion. I'm still nervous
about using 4.0.2!

Rob


Re: connection reset and I/O error

From
Kris Jurka
Date:

On Wed, 14 Sep 2005, mpr wrote:

> I'm working on an application using PostgreSQL 8.0.3 via Hibernate
> 2.1.6 in a JBoss 4.0.1 Appserver, with both appserver and
> postgres db running on the same machine with Windows XP SP2.
>
> I get the following errors in JBoss' log, does anyone know the problem
> and a solution? And yes, I already googled a lot for this problem.
> I use the postgresql-8.0-311.jdbc3.jar jdbc driver.
>

Initially this looks like a network failure with the
"java.net.SocketException: Connection reset" messages, but since you say
the database and app server are running on the same machine that seems a
little hard to believe.  What about someone restarting the database (or
the database crashing) while the app is running?  Do you see anything
relevent in the database server log?

Kris Jurka

Re: connection reset and I/O error

From
"mpr"
Date:
Yes, indeed there are some errors in postgres' log, but I cannot
identify the problem the db server has...

--snip--
2005-09-14 20:52:44 LOG:  server process (PID 4760) was terminated by
signal 66
2005-09-14 20:52:44 LOG:  terminating any other active server processes
2005-09-14 20:52:44 WARNING:  terminating connection because of crash
of another server process
2005-09-14 20:52:44 DETAIL:  The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.
2005-09-14 20:52:44 HINT:  In a moment you should be able to reconnect
to the database and repeat your command.
2005-09-14 20:52:44 WARNING:  terminating connection because of crash
of another server process
2005-09-14 20:52:44 DETAIL:  The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.
2005-09-14 20:52:44 HINT:  In a moment you should be able to reconnect
to the database and repeat your command.
[...]
--snip--