pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connection pool problem
9+ messages / 4 participants
[nested] [flat]

* Connection pool problem
@ 2005-03-01 07:56  Stéphane RIFF <stephane.riff@cerene.fr>
  0 siblings, 1 reply; 9+ messages in thread

From: Stéphane RIFF @ 2005-03-01 07:56 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

I've create a connection pool with dbcp end another with 
Jdbc3PoolingDatasource,
it seems to work well but :
My pool is a eight connections pool, the problem is when i get some 
database exception (for example
"constraint violation", "duplicate key on unique index"...) the 
connection didn't released to the pool.
After eight exception my application wait for a connection from the pool 
which nerver give one because
of the PSQLException thrown.

Does somebody know about this??

Hope it's understandable
Thanks


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.2 - Release Date: 28/02/2005




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-01 11:49  Oliver Jowett <oliver@opencloud.com>
  parent: Stéphane RIFF <stephane.riff@cerene.fr>
  0 siblings, 1 reply; 9+ messages in thread

From: Oliver Jowett @ 2005-03-01 11:49 UTC (permalink / raw)
  To: Stéphane RIFF <stephane.riff@cerene.fr>; +Cc: pgsql-jdbc

Stéphane RIFF wrote:

> I've create a connection pool with dbcp end another with 
> Jdbc3PoolingDatasource,
> it seems to work well but :
> My pool is a eight connections pool, the problem is when i get some 
> database exception (for example
> "constraint violation", "duplicate key on unique index"...) the 
> connection didn't released to the pool.
> After eight exception my application wait for a connection from the pool 
> which nerver give one because
> of the PSQLException thrown.

Perhaps your code does not release the connection to the pool correctly 
when handling the exception?

The usual way to deal with this is to put connection releasing in a 
finally block, so it's sure to be run however you exit the try{} block.

If it's not that, I'd need to see your code to debug this further.

-O



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-01 13:12  Stéphane RIFF <stephane.riff@cerene.fr>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Stéphane RIFF @ 2005-03-01 13:12 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

You're right i forgot to call close() function in the catch block
Thanks

But know i sometimes get null connections from the datasource with 
exception like this :
2005-03-01 12:23:44,156 : [WARN] ConnectionPool - 
org.postgresql.util.PSQLException: The connection attempt failed because 
Exception: java.net.BindException: Address already in use: connect
Stack Trace:

java.net.BindException: Address already in use: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at java.net.Socket.<init>(Socket.java:309)
    at java.net.Socket.<init>(Socket.java:124)
    at org.postgresql.core.PGStream.<init>(PGStream.java:47)
    at 
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
    at org.postgresql.Driver.connect(Driver.java:139)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at 
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48)
    at 
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at 
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
    at 
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
    at 
fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:97)
    at 
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:122)
    at fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:219)
    at java.lang.Thread.run(Thread.java:534)
End of Stack Trace

2005-03-01 12:23:44,156 : [WARN] SQLoader - java.lang.NullPointerException

I saw on the web that this can happened when the max number of connection
is reach but in my case postgresql is configure with 100 connections, in
the process list i had  ~50 connections.

Don't know what i can do...

Oliver Jowett wrote:

> Stéphane RIFF wrote:
>
>> I've create a connection pool with dbcp end another with 
>> Jdbc3PoolingDatasource,
>> it seems to work well but :
>> My pool is a eight connections pool, the problem is when i get some 
>> database exception (for example
>> "constraint violation", "duplicate key on unique index"...) the 
>> connection didn't released to the pool.
>> After eight exception my application wait for a connection from the 
>> pool which nerver give one because
>> of the PSQLException thrown.
>
>
> Perhaps your code does not release the connection to the pool 
> correctly when handling the exception?
>
> The usual way to deal with this is to put connection releasing in a 
> finally block, so it's sure to be run however you exit the try{} block.
>
> If it's not that, I'd need to see your code to debug this further.
>
> -O
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.2 - Release Date: 28/02/2005




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-01 13:24  Dave Cramer <pg@fastcrypt.com>
  parent: Stéphane RIFF <stephane.riff@cerene.fr>
  1 sibling, 0 replies; 9+ messages in thread

From: Dave Cramer @ 2005-03-01 13:24 UTC (permalink / raw)
  To: Stéphane RIFF <stephane.riff@cerene.fr>; +Cc: Oliver Jowett <oliver@opencloud.com>; pgsql-jdbc

Stephane,

You didn't read his email carefully enough. Close your connections in a 
FINALLY block. That way they are guaranteed to be closed

as far as your exception below, that is very strange. If you are out of 
connections on the server then you should get that error
not a bind exception ???

Dave


Stéphane RIFF wrote:

> You're right i forgot to call close() function in the catch block
> Thanks
>
> But know i sometimes get null connections from the datasource with 
> exception like this :
> 2005-03-01 12:23:44,156 : [WARN] ConnectionPool - 
> org.postgresql.util.PSQLException: The connection attempt failed 
> because Exception: java.net.BindException: Address already in use: 
> connect
> Stack Trace:
>
> java.net.BindException: Address already in use: connect
>    at java.net.PlainSocketImpl.socketConnect(Native Method)
>    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>    at java.net.Socket.connect(Socket.java:452)
>    at java.net.Socket.connect(Socket.java:402)
>    at java.net.Socket.<init>(Socket.java:309)
>    at java.net.Socket.<init>(Socket.java:124)
>    at org.postgresql.core.PGStream.<init>(PGStream.java:47)
>    at 
> org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197) 
>
>    at org.postgresql.Driver.connect(Driver.java:139)
>    at java.sql.DriverManager.getConnection(DriverManager.java:512)
>    at java.sql.DriverManager.getConnection(DriverManager.java:171)
>    at 
> org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48) 
>
>    at 
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) 
>
>    at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) 
>
>    at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) 
>
>    at 
> fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:97) 
>
>    at 
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:122)
>    at fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:219)
>    at java.lang.Thread.run(Thread.java:534)
> End of Stack Trace
>
> 2005-03-01 12:23:44,156 : [WARN] SQLoader - 
> java.lang.NullPointerException
>
> I saw on the web that this can happened when the max number of connection
> is reach but in my case postgresql is configure with 100 connections, in
> the process list i had  ~50 connections.
>
> Don't know what i can do...
>
> Oliver Jowett wrote:
>
>> Stéphane RIFF wrote:
>>
>>> I've create a connection pool with dbcp end another with 
>>> Jdbc3PoolingDatasource,
>>> it seems to work well but :
>>> My pool is a eight connections pool, the problem is when i get some 
>>> database exception (for example
>>> "constraint violation", "duplicate key on unique index"...) the 
>>> connection didn't released to the pool.
>>> After eight exception my application wait for a connection from the 
>>> pool which nerver give one because
>>> of the PSQLException thrown.
>>
>>
>>
>> Perhaps your code does not release the connection to the pool 
>> correctly when handling the exception?
>>
>> The usual way to deal with this is to put connection releasing in a 
>> finally block, so it's sure to be run however you exit the try{} block.
>>
>> If it's not that, I'd need to see your code to debug this further.
>>
>> -O
>>
>>
>
>
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-01 20:23  Oliver Jowett <oliver@opencloud.com>
  parent: Stéphane RIFF <stephane.riff@cerene.fr>
  1 sibling, 1 reply; 9+ messages in thread

From: Oliver Jowett @ 2005-03-01 20:23 UTC (permalink / raw)
  To: Stéphane RIFF <stephane.riff@cerene.fr>; +Cc: pgsql-jdbc

Stéphane RIFF wrote:

> 2005-03-01 12:23:44,156 : [WARN] SQLoader - java.lang.NullPointerException

Can you get a stack trace for this exception? (the NPE, not the earlier one)

-O



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-02 08:35  Guillaume Cottenceau <gc@mnc.ch>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Guillaume Cottenceau @ 2005-03-02 08:35 UTC (permalink / raw)
  To: Stéphane RIFF <stephane.riff@cerene.fr>; pgsql-jdbc

Oliver Jowett <oliver 'at' opencloud.com> writes:

> Stéphane RIFF wrote:
> 
> > 2005-03-01 12:23:44,156 : [WARN] SQLoader - java.lang.NullPointerException
> 
> Can you get a stack trace for this exception? (the NPE, not the earlier one)

Stephan - in case, here's a method to get a human readable
stacktrace given an Exception object, if you don't use java 1.5:

    public static String backtrace( Exception e ) {
        StackTraceElement[] trace = e.getStackTrace();
        StringBuffer sb = new StringBuffer();
        for ( int i = 2; i < trace.length; i++ ) {
            sb.append( "\t" ).append( trace[i].toString() ).append( "\n" );
        }
        return sb.toString();
    }

-- 
Guillaume Cottenceau



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-02 09:14  Stéphane RIFF <stephane.riff@cerene.fr>
  parent: Guillaume Cottenceau <gc@mnc.ch>
  0 siblings, 1 reply; 9+ messages in thread

From: Stéphane RIFF @ 2005-03-02 09:14 UTC (permalink / raw)
  To: pgsql-jdbc

Here is the NullPointerExceptionStack trace
java.lang.NullPointerException
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
        at java.lang.Thread.run(Thread.java:534)
        
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
        fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
        java.lang.Thread.run(Thread.java:534)

but it didn't give more information on the last exception
........
Thanks

Guillaume Cottenceau wrote:

>Oliver Jowett <oliver 'at' opencloud.com> writes:
>
>  
>
>>Stéphane RIFF wrote:
>>
>>    
>>
>>>2005-03-01 12:23:44,156 : [WARN] SQLoader - java.lang.NullPointerException
>>>      
>>>
>>Can you get a stack trace for this exception? (the NPE, not the earlier one)
>>    
>>
>
>Stephan - in case, here's a method to get a human readable
>stacktrace given an Exception object, if you don't use java 1.5:
>
>    public static String backtrace( Exception e ) {
>        StackTraceElement[] trace = e.getStackTrace();
>        StringBuffer sb = new StringBuffer();
>        for ( int i = 2; i < trace.length; i++ ) {
>            sb.append( "\t" ).append( trace[i].toString() ).append( "\n" );
>        }
>        return sb.toString();
>    }
>
>  
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.7 - Release Date: 01/03/2005




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-02 11:16  Stéphane RIFF <stephane.riff@cerene.fr>
  parent: Stéphane RIFF <stephane.riff@cerene.fr>
  0 siblings, 1 reply; 9+ messages in thread

From: Stéphane RIFF @ 2005-03-02 11:16 UTC (permalink / raw)
  To: pgsql-jdbc

Here is another Stack trace, i got when
doing DriverManager.setLogWriter() :

DriverManager.getConnection("jdbc:postgresql://200.200.200.34:5432/geosiaradev")
    trying 
driver[className=org.postgresql.Driver,org.postgresql.Driver@11ddcde]
org.postgresql.util.PSQLException
        at 
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:208)
        at org.postgresql.Driver.connect(Driver.java:139)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at 
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48)
        at 
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        at 
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at 
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at 
fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:101)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:210)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
        at java.lang.Thread.run(Thread.java:534)
getConnection failed: org.postgresql.util.PSQLException: The connection 
attempt failed because Exception: java.net.BindException: Address 
already in use: connect
Stack Trace:

java.net.BindException: Address already in use: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at 
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:452)
        at java.net.Socket.connect(Socket.java:402)
        at java.net.Socket.<init>(Socket.java:309)
        at java.net.Socket.<init>(Socket.java:124)
        at org.postgresql.core.PGStream.<init>(PGStream.java:47)
        at 
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197)
        at org.postgresql.Driver.connect(Driver.java:139)
        at java.sql.DriverManager.getConnection(DriverManager.java:512)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at 
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48)
        at 
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        at 
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at 
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at 
fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:101)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:210)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
        at java.lang.Thread.run(Thread.java:534)
End of Stack Trace

java.lang.NullPointerException
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:227)
        at 
fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
        at java.lang.Thread.run(Thread.java:534)


Stéphane RIFF wrote:

> Here is the NullPointerExceptionStack trace
> java.lang.NullPointerException
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
>        at java.lang.Thread.run(Thread.java:534)
>        
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
>        fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
>        java.lang.Thread.run(Thread.java:534)
>
> but it didn't give more information on the last exception
> ........
> Thanks
>
> Guillaume Cottenceau wrote:
>
>> Oliver Jowett <oliver 'at' opencloud.com> writes:
>>
>>  
>>
>>> Stéphane RIFF wrote:
>>>
>>>   
>>>
>>>> 2005-03-01 12:23:44,156 : [WARN] SQLoader - 
>>>> java.lang.NullPointerException
>>>>     
>>>
>>> Can you get a stack trace for this exception? (the NPE, not the 
>>> earlier one)
>>>   
>>
>>
>> Stephan - in case, here's a method to get a human readable
>> stacktrace given an Exception object, if you don't use java 1.5:
>>
>>    public static String backtrace( Exception e ) {
>>        StackTraceElement[] trace = e.getStackTrace();
>>        StringBuffer sb = new StringBuffer();
>>        for ( int i = 2; i < trace.length; i++ ) {
>>            sb.append( "\t" ).append( trace[i].toString() ).append( 
>> "\n" );
>>        }
>>        return sb.toString();
>>    }
>>
>>  
>>
>
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.7 - Release Date: 01/03/2005




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: Connection pool problem
@ 2005-03-03 10:06  Stéphane RIFF <stephane.riff@cerene.fr>
  parent: Stéphane RIFF <stephane.riff@cerene.fr>
  0 siblings, 0 replies; 9+ messages in thread

From: Stéphane RIFF @ 2005-03-03 10:06 UTC (permalink / raw)
  To: pgsql-jdbc

I finally get it to work. The problem doesn't come from
jdbc nor dbcp, it's because i use cygwin to connect to gnome
on the linux box. It seems that there are conflict between cygwyn ports 
and jdbc ports
Don't have a real explanation but if cygwin not running everything works 
in jdbc & dbcp
Bye

Stéphane RIFF wrote:

> Here is another Stack trace, i got when
> doing DriverManager.setLogWriter() :
>
> DriverManager.getConnection("jdbc:postgresql://200.200.200.34:5432/geosiaradev") 
>
>    trying 
> driver[className=org.postgresql.Driver,org.postgresql.Driver@11ddcde]
> org.postgresql.util.PSQLException
>        at 
> org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:208) 
>
>        at org.postgresql.Driver.connect(Driver.java:139)
>        at java.sql.DriverManager.getConnection(DriverManager.java:512)
>        at java.sql.DriverManager.getConnection(DriverManager.java:171)
>        at 
> org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48) 
>
>        at 
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) 
>
>        at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) 
>
>        at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) 
>
>        at 
> fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:101) 
>
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:210)
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
>        at java.lang.Thread.run(Thread.java:534)
> getConnection failed: org.postgresql.util.PSQLException: The 
> connection attempt failed because Exception: java.net.BindException: 
> Address already in use: connect
> Stack Trace:
>
> java.net.BindException: Address already in use: connect
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>        at 
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>        at java.net.Socket.connect(Socket.java:452)
>        at java.net.Socket.connect(Socket.java:402)
>        at java.net.Socket.<init>(Socket.java:309)
>        at java.net.Socket.<init>(Socket.java:124)
>        at org.postgresql.core.PGStream.<init>(PGStream.java:47)
>        at 
> org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:197) 
>
>        at org.postgresql.Driver.connect(Driver.java:139)
>        at java.sql.DriverManager.getConnection(DriverManager.java:512)
>        at java.sql.DriverManager.getConnection(DriverManager.java:171)
>        at 
> org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48) 
>
>        at 
> org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) 
>
>        at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771) 
>
>        at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) 
>
>        at 
> fr.cerene.geosiara.gprs.receiver.ConnectionPool.getConnection(ConnectionPool.java:101) 
>
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:210)
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
>        at java.lang.Thread.run(Thread.java:534)
> End of Stack Trace
>
> java.lang.NullPointerException
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame2(SQLoader.java:227)
>        at 
> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:317)
>        at java.lang.Thread.run(Thread.java:534)
>
>
> Stéphane RIFF wrote:
>
>> Here is the NullPointerExceptionStack trace
>> java.lang.NullPointerException
>>        at 
>> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
>>        at 
>> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
>>        at java.lang.Thread.run(Thread.java:534)
>>        
>> fr.cerene.geosiara.gprs.receiver.SQLoader.saveTrame(SQLoader.java:139)
>>        
>> fr.cerene.geosiara.gprs.receiver.SQLoader$1.run(SQLoader.java:229)
>>        java.lang.Thread.run(Thread.java:534)
>>
>> but it didn't give more information on the last exception
>> ........
>> Thanks
>>
>> Guillaume Cottenceau wrote:
>>
>>> Oliver Jowett <oliver 'at' opencloud.com> writes:
>>>
>>>  
>>>
>>>> Stéphane RIFF wrote:
>>>>
>>>>  
>>>>
>>>>> 2005-03-01 12:23:44,156 : [WARN] SQLoader - 
>>>>> java.lang.NullPointerException
>>>>>     
>>>>
>>>>
>>>> Can you get a stack trace for this exception? (the NPE, not the 
>>>> earlier one)
>>>>   
>>>
>>>
>>>
>>> Stephan - in case, here's a method to get a human readable
>>> stacktrace given an Exception object, if you don't use java 1.5:
>>>
>>>    public static String backtrace( Exception e ) {
>>>        StackTraceElement[] trace = e.getStackTrace();
>>>        StringBuffer sb = new StringBuffer();
>>>        for ( int i = 2; i < trace.length; i++ ) {
>>>            sb.append( "\t" ).append( trace[i].toString() ).append( 
>>> "\n" );
>>>        }
>>>        return sb.toString();
>>>    }
>>>
>>>  
>>>
>>
>>
>>
>
>
>




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2005-03-03 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 07:56 Connection pool problem Stéphane RIFF <stephane.riff@cerene.fr>
2005-03-01 11:49 ` Oliver Jowett <oliver@opencloud.com>
2005-03-01 13:12   ` Stéphane RIFF <stephane.riff@cerene.fr>
2005-03-01 13:24     ` Dave Cramer <pg@fastcrypt.com>
2005-03-01 20:23     ` Oliver Jowett <oliver@opencloud.com>
2005-03-02 08:35       ` Guillaume Cottenceau <gc@mnc.ch>
2005-03-02 09:14         ` Stéphane RIFF <stephane.riff@cerene.fr>
2005-03-02 11:16           ` Stéphane RIFF <stephane.riff@cerene.fr>
2005-03-03 10:06             ` Stéphane RIFF <stephane.riff@cerene.fr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox