Remote Debugger Slow Startup with JSP Breakpoints
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 16
### What happened
When attaching a remote debugging session using JDPA Socket Attach, Netbeans is very slow to attach the debugger IF there are active breakpoints in a JSP page.
In our use case, attaching the debugger WITHOUT any jsp breakpoints active, the remote debugger attaches in less than 2 seconds. WITH active JSP breakpoints, the attach time can take upward of 1 minute.

Interestingly, even with JSP breakpoints set, the Netbeans log will almost immediately print out that it has made a remote debugging connection, but the "processing" bar will stay displayed in the UI for 1 minute and we can't actually hit all jsp breakpoints until the "processing" bar completes.
INFO [org.netbeans.ui.metrics.debugger]: Connecting via connect type Java Debugger (JPDA)
INFO [org.netbeans.ui.metrics.debugger]: Debugger session localhost:8000 started at localhost for Java
So in summary, both ends are showing that a socket connection is made to the debugger point almost immediately, but Netbeans seems to take a really long time setting up the jsp breakpoints once the connection has been made.
Breakpoints in java files are not an issue.
### How to reproduce
1. Deploy a java web application containing a jsp page to a tomcat instance that is started up in debug mode.
Set these environment variables:
JPDA_ADDRESS: "*:8000"
JPDA_TRANSPORT: dt_socket
And startup tomcat with:
bin/catalina.sh jpda run
2. Open the web project source in Netbeans and set a breakpoint in the jsp page.
3. Go to Debug -> Attach Debugger, and enter the values from the screen shot below

### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 10 for Netbeans and RHEL8 in a Docker container for remote Tomcat
### JDK
JDK11 for tomcat and JDK14 for Netbeans
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
_No response_
### Are you willing to submit a pull request?
Yes
### Code of Conduct
Yes
Contributor guide
Research direction
Reproduce the remote JPDA socket attach with a Tomcat JSP breakpoint, comparing startup with and without JSP breakpoints. Start by tracing the debugger attach and JSP breakpoint setup path; no source files or tests are identified in the issue. Done means JSP breakpoints no longer cause the processing phase to take about a minute, while Java breakpoints continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100