Skip site navigation (1) Skip section navigation (2)

Malformed URLs

From: Konrad Garus <konrad(dot)garus(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Malformed URLs
Date: 2008-10-02 10:05:41
Message-ID: a1f6d2e4-f1fd-46ce-8fe6-7018b81f664f@l42g2000hsc.googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hello,

in a project I work on we recently upgraded our JDBC driver from
8.0-311.jdbc2 to 8.3-603.jdbc4. We started receiving *lots* of errors
related to too many open files that turned out to be a result of
malformed DB URL.

Some details:
 - The problematic DB URL is: jdbc:postgresql:///127.0.0.1/example
(notice the triple slash before IP)
 - It did work fine with the old 8.0 driver - no exceptions, no
problems using the DB.
 - After update, we started getting exceptions (stacktrace below).

I think it is a bug. Firstly, it did work in older versions of the
driver. Secondly, it shouldn't leave any open sockets, because this
way your app will likely have difficult to track issues with number of
open files. Where shall I submit this bug?

org.postgresql.util.PSQLException: Something unusual has occured to
cause the driver to fail. Please report this exception.
...
Caused by: java.lang.IllegalArgumentException: protocol = socket host
= null
	at sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:
146)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:358)
	at java.net.Socket.connect(Socket.java:519)
	at java.net.Socket.connect(Socket.java:469)
	at java.net.Socket.<init>(Socket.java:366)
	at java.net.Socket.<init>(Socket.java:180)
	at org.postgresql.core.PGStream.<init>(PGStream.java:62)
	at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:
77)
	at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:
66)
	at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:
124)
	at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:
30)
	at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:
29)
	at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:
24)
	at org.postgresql.Driver.makeConnection(Driver.java:386)
	at org.postgresql.Driver.connect(Driver.java:260)
	... 35 more

Thanks.
Konrad Garus

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2008-10-02 17:48:44
Subject: Re: Malformed URLs
Previous:From: Kris JurkaDate: 2008-09-30 23:42:24
Subject: Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group