oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.41k stars 1.64k forks source link

docker container cannot connect to chrome devtools #1331

Open hugsyy opened 5 years ago

hugsyy commented 5 years ago

Hello,

I am running my spring boot application in a docker container on graalvm-ce-19.0.0 image. I gave -Dpolyglot.inspect=9229 option to java command in entrypoint and published port 9229 as well. When I open chrome-devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9229/237b6cc8-e3a3f607de68 it says "Debugging connection was closed. Reason: Websocket disconnected". How can I solve this?

sapetti commented 5 years ago

Hi @hugsyy, Is it possible to debug Java applications? From the documentation seems it is only possible for guest languages: "GraalVM supports debugging of guest language applications". Where guest languages are described as "guest programming languages, namely JavaScript, Ruby, R, Python and LLVM bitcode". Anyway, I am having same issue for a NodeJS app within a docker container. Thanks

hugsyy commented 5 years ago

Hi @sapetti I am not trying to debug java. I am trying to debug JavaScript guest language of polyglot java application. And it is working, it gives me the devtools URL when I run the JavaScript code. It just doesn't connect. Probably, it has something to do with ip or port.

ThuF commented 4 years ago

Hi, I have the same issue.

I have a Java Web Application running on Tomcat and I'm able to debug it, when running locally. Once I put the application inside Docker container and try to connect the Chrome Dev Tools I got the exact same message: Debugging connection was closed. Reason: Websocket disconnected

@hugsyy Did you found a way to workaround this issue?

ThuF commented 4 years ago

Hi all,

I've found a way how to workaround this issue, just set the inspect option to 0.0.0.0:<YourPortNumber>, when running in Docker environment. Also you have to set inspect.Secure=false or you have to provide inspect.KeyStore=.... https://www.graalvm.org/docs/tools/chrome-debugger

Here is how we solved this issue in Eclipse Dirigible: https://github.com/eclipse/dirigible/issues/567

onlyGuo commented 1 year ago

Hi all,

I've found a way how to workaround this issue, just set the inspect option to 0.0.0.0:<YourPortNumber>, when running in Docker environment. Also you have to set inspect.Secure=false or you have to provide inspect.KeyStore=.... https://www.graalvm.org/docs/tools/chrome-debugger

Here is how we solved this issue in Eclipse Dirigible: eclipse/dirigible#567

Thank you. This plan is effective. It solved my problem. You are a fucking genius