Re: Connection pool problem - Mailing list pgsql-jdbc
From | Stéphane RIFF |
---|---|
Subject | Re: Connection pool problem |
Date | |
Msg-id | 4226E1B6.1000104@cerene.fr Whole thread Raw |
In response to | Re: Connection pool problem (Stéphane RIFF <stephane.riff@cerene.fr>) |
List | 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(); >>> } >>> >>> >>> >> >> >> > > >
pgsql-jdbc by date: