debug maven app locally does not work with the java debug extension
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start with the workspace launch.config for mainClass at.mytoolx.batch.mytoolAppLoader and compare the Eclipse and VS Code Java command lines shown in the report. Reproduce the local debug launch with the supplied VOR_BGZ50 argument, then inspect how the Java debug extension constructs the classpath and debug options. Done means the application reaches "Hello World" in VS Code without the reported initialization exception.
Written by the indexing model from the issue text.
Description
Hi, we have a maven app, which is deployed to the mainframe, and we building our own application to fit Java Maven apps into our vscode workflow.
So we need to debug java maven apps for quarkus (maybe open liberty) and for mainframe batch.
To Debug the app local i used this minimal snippet which is working fine in eclipse...
@Dependent
public class BGZ50FileCreator extends JhapBatchApp {
private final static String appName = "VOR_BGZ50";
@Override
public String getAppName() {
return appName;
}
@Override
public void run() throws CheckedBusinessException {
System.out.println("Hello World");
}
}
In Vscode this exception is thrown before "Hello World" is printed
Unable to invoke public void at.mysecretlib.init()
...
Caused by: java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.NullPointerException
When comparing eclipse and vscode command for debug:
eclipse:
C:\mypath\jdk\1.8.0.262-3.b10.redhat.windows.x86_64\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:62642 "-javaagent:C:\mypath2\configuration\org.eclipse.osgi\424\0.cp\lib\javaagent-shaded.jar" -Dfile.encoding=UTF-8 -classpath
"C:\mymaven\at\mytool\mytool-batch\2.171.6\mytool-batch-2.171.6.jar;
....
at.mytoolx.batch.mytoolAppLoader VOR_BGZ50
vscode:
c:\mypath\jdk\1.8.0.262-3.b10.redhat.windows.x86_64\bin\javaw.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:50209' '-cp' 'C:\myrepo\myproject\target\classes; C:\mymave\at\mytool\mytool-batch\2.171.6\mytool-batch-2.171.6.jar;
...
'at.mytoolx.batch.mytoolAppLoader' 'VOR_BGZ50'
The noteable differences are the missing javaagent, the additional "server=n" and an additional entry as first argument in classpath.
launch.config (in workspace file)
"configurations": [
{
"type": "java",
"name": "Java",
"request": "launch",
"mainClass": "at.mytoolx.batch.mytoolAppLoader",
"projectName": "myproject",
"args": "VOR_BGZ50",
"javaExec": "c:\\mypath\\jdk\\1.8.0.262-3.b10.redhat.windows.x86_64\\bin\\javaw.exe",
"shortenCommandLine": "none",
}
Thanks!
- Dominant language
- TypeScript
- Stars
- 591
- Forks
- 429
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 19
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-java-debug
-
ai-triaged enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
microsoft/vscode-java-debug#1689 · 2 comments ·
-
ai-triaged bug
microsoft/vscode-java-debug#1666 · 1 comment · 1 assignee ·
-
ai-triaged bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoft/vscode-java-debug#1658 · 1 comment ·
-
ai-triaged enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/vscode-java-debug#1628 · 3 comments ·
-
Feature support. Openai-triaged enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/vscode-java-debug#1616 · 1 comment ·
All issues in microsoft/vscode-java-debug
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·