Malformed URLs - Mailing list pgsql-jdbc

From Konrad Garus
Subject Malformed URLs
Date
Msg-id a1f6d2e4-f1fd-46ce-8fe6-7018b81f664f@l42g2000hsc.googlegroups.com
Whole thread Raw
Responses Re: Malformed URLs  (Kris Jurka <books@ejurka.com>)
Re: Malformed URLs  (Daniel Migowski <dmigowski@ikoffice.de>)
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string
Next
From: Kris Jurka
Date:
Subject: Re: Malformed URLs