You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My issue is about the documentation content or website
Type of issue
Information is incorrect
Description
Using JDK 17 and following the instructions in the section Dockerfile for development, this statement in Dockerfile does not cause the JVM to listen on port 8000:
While trying to attach to that port within the container, I get a "connection refused.":
docker compose up --build
...
docker exec -ti spring-petclinic-server-1 bash
root@95632c87fcf7:/build# jdb -attach localhost:8000
java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)
at jdk.jdi/com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:119)
at jdk.jdi/com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:83)
at jdk.jdi/com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:557)
at jdk.jdi/com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:367)
at jdk.jdi/com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at jdk.jdi/com.sun.tools.example.debug.tty.TTY.main(TTY.java:1113)
Fatal error:
Unable to attach to target VM.
While trying to attach to that port outside the container, I get "connection prematurally closed":
$ jdb -attach localhost:8000
java.io.IOException: handshake failed - connection prematurally closed
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:139)
at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:273)
at jdk.jdi/com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:119)
at jdk.jdi/com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:83)
at jdk.jdi/com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:563)
at jdk.jdi/com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:369)
at jdk.jdi/com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at jdk.jdi/com.sun.tools.example.debug.tty.TTY.main(TTY.java:1176)
Fatal error:
Unable to attach to target VM.
Is this a docs issue?
Type of issue
Information is incorrect
Description
Using JDK 17 and following the instructions in the section Dockerfile for development, this statement in Dockerfile does not cause the JVM to listen on port 8000:
While trying to attach to that port within the container, I get a "connection refused.":
While trying to attach to that port outside the container, I get "connection prematurally closed":
The following change to Dockerfile works:
Location
https://docs.docker.com/language/java/develop/#dockerfile-for-development
Suggestion
In Dockerfile, instead of:
why not replace the above with:
The text was updated successfully, but these errors were encountered: