microsoft / microsoft/vscode-java-debug

debug maven app locally does not work with the java debug extension

オープン
#1,525 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

ai-triaged question
主要言語
TypeScript
スター
591
フォーク
429
平均マージ
1日 9時間
マージ済み PR(30日)
19

説明

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

Image

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!

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

workspace launch.config の mainClass at.mytoolx.batch.mytoolAppLoader から始め、レポートに示されている Eclipse と VS Code の Java コマンドラインを比較します。指定された VOR_BGZ50 引数を使ってローカルデバッグ起動を再現し、その後、Java debug extension が classpath とデバッグオプションをどのように構築するかを調べます。VS Code でアプリケーションが報告された初期化例外なしに "Hello World" に到達すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。