Обсуждение: pq_recvbuf: recv() failed: Connection reset by peer

Поиск
Список
Период
Сортировка

pq_recvbuf: recv() failed: Connection reset by peer

От
"Bernd Brenner"
Дата:
Hello!

I have a problem with a connection between java and postgresql:

I always get the error message: pq_recvbuf: recv() failed: Connection reset
by peer


Here is my java-code:

public void open() throws Exception {
        try {
         Class.forName( "org.postgresql.Driver" );
         con = DriverManager.getConnection
               ("jdbc:postgresql:ticketline", "Beant", "masterkey");
        }
        catch(ClassNotFoundException e) {
            System.err.println("Failed to load Driver");
            System.exit(1);
        }
        catch(SQLException e) {
            System.err.println("Sql-State "+e.getSQLState());
            System.err.println("ErrorCode: "+ e.getErrorCode());
            e.printStackTrace();
        }

I have updated my classpath and postmaster is running with �-i�. Here are
also the last lines of the pg_hba.conf:

local      all                                 trust
host       all         10.1.52.61 255.255.255.0                trust
host         all        127.0.0.1   255.255.255.255        trust

I have tried to change these settings, but i didnt get a connection�





_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


Re: pq_recvbuf: recv() failed: Connection reset by peer

От
Barry Lind
Дата:
Bernd,

This error would (usually) indicate that the connection was successfully
completed, but that the client didn't close the connection before
exiting.  I don't seen in your example below where you are closing the
connection.  And also it would appear that you are not getting any
exception when you create the connection since you don't indicate in
your message any exceptions being thrown on the client side, but only
the warning being reported on the server side.

thanks,
--Barry

Bernd Brenner wrote:
>
> Hello!
>
> I have a problem with a connection between java and postgresql:
>
> I always get the error message: pq_recvbuf: recv() failed: Connection
> reset by peer
>
>
> Here is my java-code:
>
> public void open() throws Exception {
>        try {
>         Class.forName( "org.postgresql.Driver" );
>         con = DriverManager.getConnection
>               ("jdbc:postgresql:ticketline", "Beant", "masterkey");
>        }
>        catch(ClassNotFoundException e) {
>            System.err.println("Failed to load Driver");
>            System.exit(1);
>        }
>        catch(SQLException e) {
>            System.err.println("Sql-State "+e.getSQLState());
>            System.err.println("ErrorCode: "+ e.getErrorCode());
>            e.printStackTrace();
>        }
>
> I have updated my classpath and postmaster is running with “-i”. Here
> are also the last lines of the pg_hba.conf:
>
> local      all                                 trust
> host       all         10.1.52.61 255.255.255.0                trust
> host         all        127.0.0.1   255.255.255.255        trust
>
> I have tried to change these settings, but i didnt get a connection…
>
>
>
>
>
> _________________________________________________________________
> Join the world’s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



Re: pq_recvbuf: recv() failed: Connection reset by peer

От
"Bernd Brenner"
Дата:
that's it. i've forgotten to close the connection...

thanks
bernd



>From: Barry Lind <barry@xythos.com>
>To: Bernd Brenner <bernd_brenner@hotmail.com>
>CC: pgsql-jdbc@postgresql.org
>Subject: Re: [JDBC] pq_recvbuf: recv() failed: Connection reset by peer
>Date: Fri, 11 Oct 2002 09:35:21 -0700
>
>Bernd,
>
>This error would (usually) indicate that the connection was successfully
>completed, but that the client didn't close the connection before exiting.
>I don't seen in your example below where you are closing the connection.
>And also it would appear that you are not getting any exception when you
>create the connection since you don't indicate in your message any
>exceptions being thrown on the client side, but only the warning being
>reported on the server side.
>
>thanks,
>--Barry
>
>Bernd Brenner wrote:
>>
>>Hello!
>>
>>I have a problem with a connection between java and postgresql:
>>
>>I always get the error message: pq_recvbuf: recv() failed: Connection
>>reset by peer
>>
>>
>>Here is my java-code:
>>
>>public void open() throws Exception {
>>        try {
>>         Class.forName( "org.postgresql.Driver" );
>>         con = DriverManager.getConnection
>>               ("jdbc:postgresql:ticketline", "Beant", "masterkey");
>>        }
>>        catch(ClassNotFoundException e) {
>>            System.err.println("Failed to load Driver");
>>            System.exit(1);
>>        }
>>        catch(SQLException e) {
>>            System.err.println("Sql-State "+e.getSQLState());
>>            System.err.println("ErrorCode: "+ e.getErrorCode());
>>            e.printStackTrace();
>>        }
>>
>>I have updated my classpath and postmaster is running with �-i�. Here are
>>also the last lines of the pg_hba.conf:
>>
>>local      all                                 trust
>>host       all         10.1.52.61 255.255.255.0                trust
>>host         all        127.0.0.1   255.255.255.255        trust
>>
>>I have tried to change these settings, but i didnt get a connection�
>>
>>
>>
>>
>>
>>_________________________________________________________________
>>Join the world�s largest e-mail service with MSN Hotmail.
>>http://www.hotmail.com
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>>




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx