I am trying to run a Java gRPC Application on an Oracle Cloud Instance but it keeps listening only for IPv6 address
$ netstat -tulp | grep 16507
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 [::]:16507 [::]:* LISTEN 210081/java
$ sudo netstat -tulpn | grep 16507
tcp6 0 0 :::16507 :::* LISTEN 210081/java
However the same application on windows listen for both IPv4 & IPv6.
> netstat -ano | findstr :16507
TCP 0.0.0.0:16507 0.0.0.0:0 LISTENING 40124
TCP [::]:16507 [::]:0 LISTENING 40124
I even tried explicitly mentioning grpc.address = 0.0.0.0 as well as switching my gRPC Spring Boot dependency from "net.devh:grpc-server-spring-boot-starter" to "io.github.lognet:grpc-spring-boot-starter" but still nothing has changed. Has anybody faced something similar?
java -jar -Djava.net.preferIPv4Stack=true appname.jar
Fixed it.