lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Exception with java.net.preferIPv6Addresses property #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1. When the java property java.net.preferIPv6Addresses is set to true,
DriverManager.getConnection() return exception "Exception opening port H2
TCP Server (tcp://0:0:0:0:0:0:0:1:1033)"

What is the expected output? What do you see instead?

Exception opening port H2 TCP Server (tcp://0:0:0:0:0:0:0:1:1033)
(port may be in use), cause: timeout [90061-114]
    org.h2.message.Message.getSQLException(Message.java:105)
    org.h2.message.Message.getSQLException(Message.java:116)
    org.h2.tools.Server.start(Server.java:359)
    org.h2.engine.Database.startServer(Database.java:674)
    org.h2.engine.Database.open(Database.java:557)
    org.h2.engine.Database.openDatabase(Database.java:219)
    org.h2.engine.Database.<init>(Database.java:214)
    org.h2.engine.Engine.openSession(Engine.java:58)
    org.h2.engine.Engine.openSession(Engine.java:140)
    org.h2.engine.Engine.getSession(Engine.java:120)
    org.h2.engine.SessionFactoryEmbedded.createSession
(SessionFactoryEmbedded.java:17)
    org.h2.engine.SessionRemote.connectEmbeddedOrServer
(SessionRemote.java:245)
    org.h2.engine.SessionRemote.createSession(SessionRemote.java:223)
    org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:105)
    org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:89)
    org.h2.Driver.connect(Driver.java:58)
    java.sql.DriverManager.getConnection(DriverManager.java:582)
    java.sql.DriverManager.getConnection(DriverManager.java:185) 

What version of the product are you using? On what operating system, file
system, and virtual machine?

I use the 1.1.114 with Windows XP. (Work correctly on Linux)

Do you know a workaround?

I have create a patch (see attach file)

How important/urgent is the problem for you?

This bug is blocking because I can't start database

In your view, is this a defect or a feature request?

It's a defect.

Please provide any additional information below.

The IPv6 address must be prefixed and suffixed with [ and ] in H2 but the
InetAddress.getHostAddress() return IPv6 without this chars.

Original issue reported on code.google.com by Aurelien...@gmail.com on 9 Jun 2009 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

I have committed your changes. Unfortunately, it still doesn't work for me on 
Mac OS
X (it seems to be a browser problem, not sure - both Firefox and Safari don't 
connect
to the web server). Connecting from an application seems to work now however.

Could you verify if it works for you? You would need to get the latest source 
code
and compile it yourself however.

Original comment by thomas.t...@gmail.com on 13 Jun 2009 at 9:46

GoogleCodeExporter commented 9 years ago
Thanks

I have test under windows it's OK, application start with IPv6. Firefox open 
console
with IPv6 url.
Under linux the jvm continue to return the special IPv4 127.0.0.1 for 
localhost. That
is the reason why I haven't detect bug on this system.

For your mac, maybe the firefox property "network.dns.disableIPv6" is set to 
true
(about:config). And similar problem with safari.

Just a detail, the ant task for "switchSourcePrepare" try build 
SwitchSource.java in
1.4 but this source file use 1.5 generics

Original comment by Aurelien...@gmail.com on 13 Jun 2009 at 3:50

GoogleCodeExporter commented 9 years ago
Mac OS: network.dns.disableIPv6 is false.

build.xml / switchSourcePrepare: this will be fixed in the next release.

I'm setting this bug to 'fixed' for now, please re-open if you have more 
information.

Original comment by thomas.t...@gmail.com on 18 Jun 2009 at 7:38