Skip to content

Cannot read field "path" because "lspFrame.source" is null #612

Description

@BenLocal

The latest version 0.58.3 has this problem where breakpoints don't hit properly. Rolling back to version 0.58.2 works normally.

Environment:

eclipse.buildId=unknown
java.version=21.0.8
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  --pipe=/tmp/lsp-28f8edb1a61755b1a3ed93afcca034cb.sock
Command-line arguments:  -data /root/.cursor-server/data/User/workspaceStorage/878dfebfddcc460ff6dbd940aeaa628a/redhat.java/jdt_ws --pipe=/tmp/lsp-28f8edb1a61755b1a3ed93afcca034cb.sock

This is a continuation of log file /root/.cursor-server/data/User/workspaceStorage/878dfebfddcc460ff6dbd940aeaa628a/redhat.java/jdt_ws/.metadata/.bak_0.log
Created Time: 2025-11-07 10:13:20.999

Exception:

!ENTRY java-debug 1 0 2025-11-07 10:14:49.557
!MESSAGE 
[request]
{"command":"stackTrace","arguments":{"threadId":62,"startFrame":0,"levels":20},"type":"request","seq":35}

!ENTRY java-debug 4 0 2025-11-07 10:14:49.588
!MESSAGE [error response][stackTrace]: Cannot read field "path" because "lspFrame.source" is null
!STACK 0
java.lang.NullPointerException: Cannot read field "path" because "lspFrame.source" is null
	at com.microsoft.java.debug.core.adapter.handler.StackTraceRequestHandler.handle(StackTraceRequestHandler.java:118)
	at com.microsoft.java.debug.core.adapter.DebugAdapter.lambda$dispatchRequest$0(DebugAdapter.java:94)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(Unknown Source)
	at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:93)
	at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:132)
	at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:81)
	at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Activity

  1. macauyeah commented on Nov 12, 2025

    @macauyeah

    I got the same issue when using open vsx version of vscode-java-debug 0.58.3.

    when i inspect extension dependency jar ~/.vscode/extensions/vscjava.vscode-java-debug-0.58.3/server/com.microsoft.java.debug.plugin-0.53.2.jar, I think the problem is that vscode-java-debug 0.58.3 using an pre release version of java-debug .

    java-debug 0.53.2 is keep changing. if you download the today's latest com.microsoft.java.debug.plugin-0.53.2.jar, and put back to extension folder, the lspFrame.source should be fixed

  2. macauyeah commented on Nov 13, 2025

    @macauyeah

    I test multiple combination of vscode-java-debug 0.58.3 with java-debug 0.53.2

    • java-debug 0.53.2 905c7ba (current main), the issue "lspFrame.source" is null occurs.
    • java-debug 0.53.2 4c80493 . the issue "lspFrame.source" is null occurs.
    • java-debug 0.53.2 ab5d534 . it works fine. the breakpoints show correctly.
    • java-debug 0.53.1 5c7562a . it works fine. the breakpoints show correctly.

    It looks like the vscode-java-debug 0.58.3 in https://marketplace.visualstudio.com cached with old jar but is workable java-debug 0.53.2. If we checkout vscode-java-debug 0.58.3 and java-debug latest main, build it from source, just like open vsx marketplace, the issue "lspFrame.source" is null occurs .

    I got the same issue when using open vsx version of vscode-java-debug 0.58.3.

    when i inspect extension dependency jar ~/.vscode/extensions/vscjava.vscode-java-debug-0.58.3/server/com.microsoft.java.debug.plugin-0.53.2.jar, I think the problem is that vscode-java-debug 0.58.3 using an pre release version of java-debug .

    java-debug 0.53.2 is keep changing. if you download the today's latest com.microsoft.java.debug.plugin-0.53.2.jar, and put back to extension folder, the lspFrame.source should be fixed

  3. BenLocal commented on Nov 13, 2025

    @BenLocal
    Author

    I think it's caused by the modification at line 226 in commit 4c80493. In some cases where clientSource is null, the modification clientLineNumber = 0; causes clientLineNumber and lspFrame.line to definitely be different.

    line208 convertDebuggerStackFrameToClient() method:

            Types.Source clientSource = convertDebuggerSourceToClient(jdiFrame.typeName, jdiFrame.sourceName, jdiFrame.sourcePath, context);
            String methodName = formatMethodName(jdiFrame.methodName, jdiFrame.argumentTypeNames, jdiFrame.typeName, true, true);
            int clientLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber, context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());    <-- 1️⃣ clientLineNumber
            // Line number returns -1 if the information is not available; specifically, always returns -1 for native methods.
            String presentationHint = null;
            if (clientLineNumber < 0) {
                presentationHint = "subtle";
                if (jdiFrame.isNative) {
                    // For native method, display a tip text "native method" in the Call Stack View.
                    methodName += "[native method]";
                } else {
                    // For other unavailable method, such as lambda expression's built-in methods run/accept/apply,
                    // display "Unknown Source" in the Call Stack View.
                    clientSource = new Types.Source("Unknown Source", "unknown", 0);
                }
                // DAP specifies lineNumber to be set to 0 when unavailable
                clientLineNumber = 0;              <-- 2️⃣ clientLineNumber changed,and assigned to lspFrame.line

    line116 handle() method:

                        int jdiLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber,
                                context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());    <--  Same as 1️⃣ clientLineNumber
                        if (jdiLineNumber != lspFrame.line) {       <--  lspFrame.line same as 2️⃣ clientLineNumber
                            decompiledClasses.add(lspFrame.source.path);
                        }
  4. chagong commented on Dec 8, 2025

    @chagong
    Contributor

    shiben (@BenLocal) can you share some sample code to repro the issue?

  5. BenLocal commented on Dec 8, 2025

    @BenLocal
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions