Skip to content

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

Closed

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.

Activity

  1. github-actions commented on Feb 25, 2026

    @github-actions

    Hi jg-shinji-ueda, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Suggested Workarounds and References

    • Workaround: Set breakpoints in the generated servlet source (index_jsp.java) on executable lines. These breakpoints will be verified and will map back to your JSP at runtime (e.g. the out.print(…) call).

    • Enable debug adapter logging to diagnose why JSP breakpoints are unverified:

    // in your settings.json
    "java.debug.settings.dap.logLevel": "verbose"

    Then inspect the Debug Console for messages like “Failed to set breakpoint”.

    • File an enhancement request against the Java debugger to improve JSP/SMAP breakpoint verification in vscode-java-debug.

    High-Confidence Reference

    • Unverified Breakpoint #1268
    – Shows grey/unverified breakpoints when they’re placed on non-executable lines and explains that only executable lines can be hot-swapped and hit.
    • URL: redhat-developer/vscode-java#1268

    Other references with low confidence

    • Breakpoints run to a wrong code line #998
    – Reports mismatched source-to-bytecode line mapping in Spring Boot; not JSP-specific but also about mapping inconsistencies.
    • URL: #998

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  2. jg-shinji-ueda commented on Feb 26, 2026

    @jg-shinji-ueda
    Author

    Thanks for the suggestions. I tested this again and wanted to share concrete results.

    Environment:

    • VS Code Java debugger (v0.58.5)
    • Tomcat 10.1.52
    • JPDA port 8000

    Observed behavior:

    1. JSP line breakpoints are still unverified.
    2. In generated servlet source (org.apache.jsp.WEB_002dINF.contents.index_jsp), a breakpoint in _jspService (for example line 145) is verified but never hit.
    3. A breakpoint at line 42 in index_jsp.java is hit, but that appears to be static initialization (class load), not request-time JSP execution.
    4. Controller-side breakpoints are hit as expected, so debugger attach itself is working.

    So in my case, the “use generated servlet breakpoints” workaround is not sufficient for request-time JSP debugging.
    If useful, I can provide verbose DAP logs and a minimal repro project.

  3. wenytang-ms commented on Mar 2, 2026

    @wenytang-ms
    Contributor

    jg-shinji-ueda Please provide a complete project and detailed reproduction steps so that we can accurately debug and confirm the issue. Thank you.

  4. jg-shinji-ueda commented on Mar 6, 2026

    @jg-shinji-ueda
    Author

    wenyt (@wenytang-ms)
    Thank you for replay. 😄

    Oh, complete project ..

    I have internal code in that project.

    Please bear with me while I prepare it! I'll get a sample project ready for sharing.

    If you need any information beforehand, even partial, please let me know what you require.

    Best regards.

  5. wenytang-ms commented on Mar 6, 2026

    @wenytang-ms
    Contributor

    please provide the project and repro steps. thanks!
    if there any record is best!

  6. github-actions commented on Mar 21, 2026

    @github-actions

    This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

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