[Bug 239890] java/openjdk11: openjdk 11.0.4+11.2 JDBC connections fail with IPv6 addresses

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 239890] java/openjdk11: openjdk 11.0.4+11.2 JDBC connections fail with IPv6 addresses

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239890

            Bug ID: 239890
           Summary: java/openjdk11: openjdk 11.0.4+11.2 JDBC connections
                    fail with IPv6 addresses
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [hidden email]
          Reporter: [hidden email]
             Flags: maintainer-feedback?([hidden email])
          Assignee: [hidden email]

1.stormblade:jdbc-test,9:19am> cat J.java
import java.sql.*;

public class J
{
        public static void
        main (
                String args[])
                throws Exception
        {
                String url = "jdbc:postgresql://[::1]/postgres?user=postgres";
                Connection conn = DriverManager.getConnection(url);
        }
}
1.stormblade:jdbc-test,9:20am> fetch
https://jdbc.postgresql.org/download/postgresql-42.2.6.jar
postgresql-42.2.6.jar                                  823 kB  337 kBps    03s
1.stormblade:jdbc-test,9:20am> setenv JAVA_HOME /usr/local/openjdk8
1.stormblade:jdbc-test,9:20am> javac J.java
1.stormblade:jdbc-test,9:21am> java -cp .:postgresql-42.2.6.jar J
1.stormblade:jdbc-test,9:21am> setenv JAVA_HOME /usr/local/openjdk11
1.stormblade:jdbc-test,9:21am> java -cp .:postgresql-42.2.6.jar J
Exception in thread "main" org.postgresql.util.PSQLException: The connection
attempt failed.
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292)
        at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
        at org.postgresql.Driver.makeConnection(Driver.java:458)
        at org.postgresql.Driver.connect(Driver.java:260)
        at
java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
        at
java.sql/java.sql.DriverManager.getConnection(DriverManager.java:251)
        at J.main(J.java:11)
Caused by: java.net.SocketException: Protocol family unavailable
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at
java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at
java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at
java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
        at java.base/java.net.Socket.connect(Socket.java:591)
        at org.postgresql.core.PGStream.<init>(PGStream.java:75)
        at
org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91)
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
        ... 7 more
1.stormblade:jdbc-test,9:24am> java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-2)
OpenJDK 64-Bit Server VM (build 11.0.4+11-2, mixed mode)

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "[hidden email]"