Netbeans debugger stopping in wrong project file

690 Views Asked by At

I have two projects on netbeans. Project A and Project B, both have an index.jsp file. I have a breakpoint on Project B in index.jsp. I right clicked on the project and put 'Clean and Build', then I right clicked on it and selected Debug. When the application starts up the browser takes it to the correct page, but the debugger stops in Project A's index.jsp file. Why? I tried cleaning the project, clearing netbeans cache, deleting target files. Nothing works, any ideas?

1

There are 1 best solutions below

0
asbachb On

The problem is that NetBeans mostly attaches all sources of your open projects to a debug session. So when you have two project with the same named jsp in the same location NetBeans choose one which might be the wrong one. The same problem occors when you've the same classes in the same package in different projects.

How to resolve:

  1. Close the other project
  2. Disable the sources for debugging: Window > Debugging > Sources