Open mpsq opened 4 years ago
Have you tried like this:
:args ["-d" "/var/lib/stuff"]
Yes, I tried with only :type "java" :args ["-d" "/var/lib/stuff"]
and I get the same issue.
ok, can you set dap-print-io to t and provide the logs from Messages buffer.
I get the following:
Sending:
{
"command": "initialize",
"arguments": {
"clientID": "vscode",
"clientName": "Visual Studio Code",
"adapterID": "java",
"pathFormat": "path",
"linesStartAt1": true,
"columnsStartAt1": true,
"supportsVariableType": true,
"supportsVariablePaging": true,
"supportsRunInTerminalRequest": true,
"locale": "en-us"
},
"type": "request",
"seq": 1
}
Received:
{
"type": "response",
"seq": 1,
"body": {
"supportsDataBreakpoints": true,
"exceptionBreakpointFilters": [
{
"filter": "uncaught",
"label": "Uncaught Exceptions"
},
{
"filter": "caught",
"label": "Caught Exceptions"
}
],
"supportsExceptionInfoRequest": true,
"supportsLogPoints": true,
"supportsDelayedStackTraceLoading": null,
"supportTerminateDebuggee": true,
"supportsRestartRequest": null,
"supportsSetVariable": true,
"supportsRestartFrame": true,
"supportsCompletionsRequest": true,
"supportsEvaluateForHovers": true,
"supportsConditionalBreakpoints": true,
"supportsHitConditionalBreakpoints": true,
"supportsConfigurationDoneRequest": true
},
"command": "initialize",
"request_seq": 1,
"success": true
}
Sending:
{
"command": "launch",
"arguments": {
"type": "java",
"args": "-d /home/mpsq/.questdb",
"mainClass": "io.questdb/io.questdb.ServerMain",
"projectName": "core",
"cwd": "/home/mpsq/quest/questdb/",
"stopOnEntry": false,
"host": "localhost",
"console": "internalConsole",
"request": "launch",
"modulePaths": [],
"name": "ServerMain (core)",
"debugServer": 45923,
"__sessionId": "1589268537.356324"
},
"type": "request",
"seq": 2
}
Received:
{
"type": "response",
"seq": 2,
"body": {
"error": {
"format": "Failed to launch debuggee VM. Missing mainClass or modulePaths/classPaths options in launch configuration.",
"id": 1004
}
},
"command": "launch",
"request_seq": 2,
"message": "Failed to launch debuggee VM. Missing mainClass or modulePaths/classPaths options in launch configuration.",
"success": null
}
Debug session process exited with status: deleted
When I do the same in VSCode I get:
!ENTRY java-debug 1 0 2020-05-12 08:54:19.283
!MESSAGE
[request]
{
"command": "launch",
"arguments": {
"type": "java",
"name": "Debug (Launch)-ServerMain<core>",
"request": "launch",
"mainClass": "io.questdb/io.questdb.ServerMain",
"args": "-d /home/mpsq/.questdb",
"projectName": "core",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"modulePaths": [
"/home/meril/quest/questdb/core/target/classes",
"/home/meril/.m2/repository/org/jetbrains/annotations/17.0.0/annotations-17.0.0.jar"
],
"classPaths": [],
"javaExec": "/usr/lib/jvm/java-11-openjdk/bin/java",
"cwd": "/home/mpsq/quest/questdb",
"shortenCommandLine": "argfile",
"debugServer": 42101,
"__sessionId": "527d3501-e08e-436f-af1b-93672daf5515"
},
"type": "request",
"seq": 2
}
!ENTRY java-debug 1 0 2020-05-12 08:54:19.284
!MESSAGE Trying to launch Java Program with options:
main-class: io.questdb/io.questdb.ServerMain
args: -d /home/mpsq/.questdb
module-path:
class-path:
vmArgs: -Dfile.encoding=UTF-8 @/tmp/cp_5e9x0velhy4p83z3u6z8odyn2.argfile
!ENTRY java-debug 1 0 2020-05-12 08:54:19.284
!MESSAGE
[[REQUEST]]
Content-Length: 445
{
"command": "runInTerminal",
"arguments": {
"kind": "integrated",
"title": "Java Debug Console",
"cwd": "/home/meril/quest/questdb",
"args": [
"/usr/lib/jvm/java-11-openjdk/bin/java",
"-agentlib:jdwp\u003dtransport\u003ddt_socket,server\u003dn,suspend\u003dy,address\u003dlocalhost:37509",
"-Dfile.encoding\u003dUTF-8",
"@/tmp/cp_5e9x0velhy4p83z3u6z8odyn2.argfile",
"-m",
"io.questdb/io.questdb.ServerMain",
"-d",
"/home/mpsq/.questdb"
]
},
"seq": 2,
"type": "request"
}
!ENTRY java-debug 1 0 2020-05-12 08:54:19.323
!MESSAGE
[response]
{
"type": "response",
"seq": 3,
"command": "runInTerminal",
"request_seq": 2,
"success": true,
"body": {
"shellProcessId": 7895
}
}
If I set the modulePaths
manually:
:modulePaths [
"/home/mpsq/quest/questdb/core/target/classes"
"/home/mpsq/.m2/repository/org/jetbrains/annotations/17.0.0/annotations-17.0.0.jar"
]
It actually works. I suspect there is an issue with the way we retrieve the modulePaths
automatically when not set.
this part is not there i think, I will fix the template later today and ask you to test.
Hello, I think I also hit the same wall. I still had to update modulePaths manually to get it to work. Any update on this issue?
Thanks
This issue is actually fixed for me, since Ivan's update it works nicely on my side.
I've just update my lsp and dap and still got the same result. Am I missing something here?
And here is log from dap:
Sending: { "command": "launch", "arguments": { "name": "Java Run Configuration<3>", "type": "java", "request": "launch", "args": "", "cwd": "/tmp/delta/mazda/", "stopOnEntry": false, "host": "localhost", "modulePaths": [], "classPaths": [], "projectName": "mazda", "mainClass": "com.serezlan.mazda/com.serezlan.mazda.App", "console": "internalConsole", "debugServer": 45255, "__sessionId": "1616041551.2389154" }, "type": "request", "seq": 2 } Received: { "success": null, "message": "Failed to launch debuggee VM. Missing mainClass or modulePaths/classPaths options in launch configuration.", "request_seq": 2, "command": "launch", "body": { "error": { "id": 1004, "format": "Failed to launch debuggee VM. Missing mainClass or modulePaths/classPaths options in launch configuration." } },
As additional info:
I am trying to have the debugger working with my Java project.
The app relies on 1 external argument to be set in order to run, therefore I created my own
launch
debugging template with:But when I try to run the template, I get the error:
With the stack trace:
I spent quite a long time debugging this + I tried to set
modulePaths
and/orclassPaths
but nothing seems to be fixing it. It is worth noticing that everything was working fine with Java 8, but after migrating to Java 11 the moduleio.questdb
seems to be an issue.Notes:
java -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:40015 -Dfile.encoding=UTF-8 -m io.questdb/io.questdb.ServerMain -d /var/lib/stuff
(notice the-m
) when I use the same debugging templatedap-java--select-main-class
.emacs.d/workspaces
folder to make sure it was not an issue with the Java migrationjdtls
maven
and everything is fine on that front (compiling with module support set inpom.xml
)Based on this I am not sure what is wrong, is seems to me that
dap-java.el
is not necessarily producing the correct command in the context of Java 11 with modules? Or maybe there is a bug in java-debug and the module is not identified properly?Thanks for your help