Skip to content

JSP breakpoints are often unverified, but breakpoints in generated index_jsp.java map and stop in index.jsp #1613

@jg-shinji-ueda

Description

@jg-shinji-ueda

Summary

In VS Code (Java debugger attach mode), breakpoints set directly in JSP are frequently shown as Unverified breakpoint.

However, if I set a breakpoint in the generated servlet source (index_jsp.java) on an executable line, the debugger can stop and map back to the corresponding line in index.jsp.

This looks like a JSP/SMAP line mapping + breakpoint verification inconsistency.

Environment

  • VS Code:
    • Version: 1.109.5 (user setup)
    • Commit: 072586267e68ece9a47aa43f8c108e0dcbf44622
    • Date: 2026-02-19T19:43:32.382Z
    • Electron: 39.3.0
    • Chromium: 142.0.7444.265
    • Node.js: 22.21.1
    • OS: Windows_NT x64 10.0.26200
  • WSL:
    • Ubuntu 20.04 LTS (Focal Fossa)
  • Extensions:
    • Debugger for Java (vscjava.vscode-java-debug) v0.58.5
    • Extension Pack for Java (vscjava.vscode-java-pack) v0.30.5
    • Language Support for Java by Red Hat (redhat.java) v1.52.0
  • Java/Build tools:
    • java (sdk env output): 11.0.28-tem
    • java --version output at runtime: OpenJDK 21.0.8 Temurin
    • ant: 1.10.14
    • maven: 3.9.12
  • Tomcat:
    • Apache Tomcat 9.0.115

Debug configuration (launch.json)

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Attach to Tomcat9 (Manual Start)",
      "type": "java",
      "request": "attach",
      "hostName": "localhost",
      "port": 8000
    },
    {
      "name": "Redeploy + Start + Attach (Tomcat9)",
      "type": "java",
      "request": "attach",
      "hostName": "localhost",
      "port": 8000,
      "preLaunchTask": "ant: debug-redeploy-start"
    }
  ]
}

Reproduction project snippets

JSP source

WebContent/WEB-INF/contents/index.jsp

<%
...
String aaa = (String)(request.getAttribute("aaa"));
%>
...
<div>
<%=aaa%>
</div>

Generated servlet source

<CATALINA_BASE>/work/Catalina/localhost/jg-web3/org/apache/jsp/WEB_002dINF/contents/index_jsp.java

...
String aaa = (String)(request.getAttribute("aaa"));
...
out.print(aaa);
...

Steps to reproduce

  1. Start Tomcat with JPDA enabled (port 8000).
  2. Attach using VS Code Java debugger.
  3. Set breakpoint directly in index.jsp scriptlet line(s).
  4. Access the page.
  5. Observe: breakpoint is often Unverified breakpoint and not hit.
  6. Open generated index_jsp.java under Tomcat work directory.
  7. Set breakpoint on an executable line in index_jsp.java.
  8. Access the same page again.
  9. Observe: debugger can stop, and VS Code maps to index.jsp line.

Actual behavior

  • JSP breakpoints are frequently unverified.
  • Breakpoints in index_jsp.java only work on executable lines.
  • If the line is executable, stop can map to same line number in JSP.
  • Breakpoints on blank/non-executable lines in index_jsp.java do not stop.

Expected behavior

  • Breakpoints set on executable JSP lines should be verified and consistently hit.
  • JSP source breakpoint behavior should be consistent with generated servlet mapping.

Additional notes

  • This behavior suggests a gap in JSP source mapping / breakpoint verification handling.
  • It would be helpful if debugger diagnostics clarified why a JSP breakpoint is unverified.

Evidence

  • VS Code UI shows Unverified Breakpoint on JSP lines (screenshot attached).
  • Generated servlet breakpoints can be hit only on executable lines.

in additional

This investigation and report were prepared in collaboration with GPT-5.3-Codex.

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