79867

Spring boot application listens over IPv6 without -Djava.net.preferIPv4Stack=true and -Djava.net.pre

Question:

<br /> My question about Spring boot jar. When running jar on production machine as: <br />

java -jar xyz.jar

It does not respond to my request. Because it is listening on ipv6.

But when I run application as <br /> java -jar xyz.jar -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses

It responds my requests.

Is it the production machine's configuration which cause the application to listen over ipv6, or is there any other reasons?

Fortunately <br /> -Djava.net.preferIPv4Stack=true <br /> -Djava.net.preferIPv4Addresses <br /> parameters solved my problem. But I am confused!!

Note: Tomcat is used as embedded server. <br />Spring boot version 1.5.4 RELEASE

Answer1:

Here <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/index.html" rel="nofollow">https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/index.html</a> I read that "The Java networking stack first checks whether IPv6 is supported on the underlying OS. If IPv6 is supported, it tries to use the IPv6 stack."

To check if your Linux machine supports IPv6, simply run "cat /proc/net/if_inet6" and if you see some output it means it's enabled.

Recommend

  • how to modify web.xml for multiple servlet
  • Add string to string in C with safe functions
  • Forcing TLS 1.1 or higher on node.js
  • share user sessions between Node.js and Clojure
  • how to use ssl/tls in paho mqtt using python i got certificate verify failed
  • Excel VBA Range object Error in Looping Through Worksheet
  • Progressive cart item fee based on state and on product category in Woocommerce
  • Check if Timer is running
  • Core Data Optimize Fetch Request
  • Catch panning event in Highcharts
  • Copy and reformat cells from one worksheet to another
  • TeamCity: Scripting elements jsp:declaration, jsp:expression, jsp:scriptlet are disallowed here
  • Downloading articles from multiple urls with newspaper
  • XCode 5 crash on loading the project
  • Stop the background service after particular time in android
  • JSON.stringify() - Escaping Issue
  • .Net how to set IsReadOnly for a property for a usercontrol
  • Random number of FORM fields being prepared for database
  • Highcharts Drawing a line with chart.renderer.path
  • Creating and managing two independent random number sequences
  • Implementing type equation generator in OCaml
  • android check if file exists with case sensitivity?
  • Example of using Service Exists MSBuild task in Microsoft.Sdc.Tasks?
  • Firestore: Version history of documents
  • How to get “crispEdges” for SVG text?
  • Adding horizontal slider to QTableWidget
  • Why do you need 2 Javascript files for cross-platform Cordova plugin?
  • Arraylist of strings into one comma separated string
  • How to resolve this in PHPUnit where it is asking me to set KERNEL_DIR in my phpunit.xml?
  • How do I use libcurl to printf a remote FTP directory listing?
  • Ember.js + JQuery-UI Tooltip - Tooltip does not reflect the model / controller changes
  • using maven pom while creating jar:test-jar some times it says JAR will be empty - no content was ma
  • Running R's aov() mixed effects model from Python using rpy2