question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

preferIPv6Addresses in dev mode

See original GitHub issue

Description of the bug / feature

Starting vaadin 17 in dev mode and with -Djava.net.preferIPv6Addresses=true results in

java.net.ConnectException: Connection refused: no further information
	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:660) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:549) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:648) ~[na:na]
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1261) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1194) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1082) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1016) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1600) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1528) ~[na:na]
	at com.vaadin.flow.server.frontend.FrontendUtils.getFileFromWebpack(FrontendUtils.java:602) ~[flow-server-4.0.7.jar:4.0.7]
	at com.vaadin.flow.server.frontend.FrontendUtils.getFileContent(FrontendUtils.java:462) ~[flow-server-4.0.7.jar:4.0.7]

Versions:

- Vaadin / Flow version: 17.0.10
- Java version: 15.0.1.9-hotspot
- OS version: windows 10
- IDE (if applicable): eclipse

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BrunoEberhardcommented, Dec 14, 2020

I use MS SQL Server. In the example how to connect to that DB the flag is listed. I did just copy/paste all the flags and wasn’t aware of the side effects. It works without the flag so no high prio for me. It just was annoying to debug for several hours so I sent you this issues.

1reaction
BrunoEberhardcommented, Nov 30, 2020

When the application is running you can reproduce the bug with

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;

public class Test {

	public static void main(String[] args) throws Exception {
		URL uri = new URL("http://localhost:57088/VAADIN/index.html");
		
		HttpURLConnection connection = (HttpURLConnection) uri.openConnection();
		connection.setRequestMethod("GET");
		
		try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
		    String pageText = reader.lines().collect(Collectors.joining("\n"));
		    System.out.println(pageText);
		}
		
	}

}

(of course with adjusted port number)

Read more comments on GitHub >

github_iconTop Results From Across the Web

IPv6 has a wrong default behaviour · Issue #2539 - GitHub
preferIPv6Addresses and set it to a string true . Unfortunately, it looks like Cyberduck still prefers IPv4. What should the Info.plist look like...
Read more >
5.3.3. Configure JVM Stack Preferences for IPv6 Addresses
This topic covers configuring the JBoss Enterprise Application Platform 6 installation to prefer IPv6 addresses through the configuration files.
Read more >
Using Amazon S3 dual-stack endpoints - AWS Documentation
You can access an S3 bucket through a dual-stack endpoint by using a virtual hosted-style or a path-style endpoint name. Amazon S3 supports...
Read more >
InetAddress.getAllByName() only receives IPv4 addresses ...
preferIPv6Addresses ", "true"); solves the problem on android, so now the issue is isolated to my iPhone5 on the NAT64 network. My best...
Read more >
Support for IPv6 Addresses - TIBCO Product Documentation
The default format is IPv4, unless the agent developer enables the IPv6 address format explicitly by setting the java.net.preferIPv6addresses property.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found