vscode-java-debug
vscode-java-debug copied to clipboard
cant remote debug on tomcat via attach
i'm trying to remote debug my application, which is running on a tomcat.
Environment
- Operating System: mac OS 10.14.4
- JDK version: 1.8.0_131
- Visual Studio Code version: 1.34.0
- Java extension version: 0.7.1
- Java Debugger extension version: 0.18.0
Steps To Reproduce
my configuration:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 8090
},
]
}
[attach a sample project reproducing the error] attach logs
Current Result
i'm getting an error message in vscode: Timeout occured while waiting for packet 106
Expected Result
debugger attaches to the remote tomcat just fine
Additional Informations
the same configuration works with intelliJ idea, so it should work in vscode.
idea connects fine with host: localhost, port: 8090
idea shows these params: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8090
do i have to add them somewhere for vscode?
just noticed this output in the debug console: is that the cause?
[Warn] The debugger and the debuggee are running in different versions of JVMs. You could see wrong source mapping results.
Debugger JVM version: 1.8.0_131
Debuggee JVM version: 1.8.0_181
Have you compiled the project? Second thing, tell me what's the command you have used to make the server?
i built it and deployed it, i can debug it just fine in intelliJ idea. i didnt setup the tomcat, my experience with administration and setting up these servers is a bit limited
just noticed this output in the debug console: is that the cause?
[Warn] The debugger and the debuggee are running in different versions of JVMs. You could see wrong source mapping results. Debugger JVM version: 1.8.0_131 Debuggee JVM version: 1.8.0_181
This problem happens when you use Intellij idea JDK. The version of the JDK intellij idea uses is older than the requirements of vs code . if you installed a jdk now. It will work. See issue #30.
awesome thanks! i'll give it a try and close this issue if it works!
OK. Please tell me the results. And don't forget to set it up in the path an JAVA_HOME.
@kvonspiczak could you mind share us the log file? Run VS Code command "Java: Open Java Language Server log file" to get the log.
i downloaded the latest from oracle, but now it seems like my version is too "new".
Debugger JVM version: 1.8.0_211
Debuggee JVM version: 1.8.0_181
sure @testforstephen export.log
The JVM version mismatch is just a warning, not the root cause of the attach failure. Looks like it's network issue.
i'm using a SSH tunnel to connect to the remote tomcat, but it works with the same configuration in intelliJ idea
Does the error continue or just that warning?
i keep getting the error, last time it took a bit longer until the error came up. the warning is also still there