1
votes

We are using NetBeans 8.1 (in Netbeans 8.0.2 we suffer the same bug) for a project with multiple JSP and, after setting breakpoints at some parts of the code, it decided not to stop at them while debugging. The most interesting part is that it worked last week normally, so I can't find any sense in this sudden failure. Example: we added an alert to check its functioning and put a breakpoint on it. When debugging this alert appears, but in NetBeans debug has done nothing (totally ignored breakpoints and can't use any button like "step over" or "continue", only "pause" and "stop" can be pressed).

If someone knows how to deal with this problem, please help us, we are in a hurry to continue the project and we haven't find any post with a similar bug.

2
The debugger does not think your code corresponds to the classes it sees. Most likely the deployment us out of sync. - Thorbjørn Ravn Andersen
How can we make sure it gets synchronized? - Gerard Visa
Ensure that the code running on the Tomcat server is exactly the same as you have in Netbeans. If this doesn't help you may have to consider setting up Netbeans and/or Tomcat again from scratch. - Thorbjørn Ravn Andersen

2 Answers

0
votes

Anderson is correct, the IDE can't match your code to the compiled classes. When this happens on my environment these are the steps I take:

  • Close your IDE
  • Clean and recompile your code using your desired build tool (Maven, Gradle...)
  • Open your IDE again, and rebuild (or clean and compile) the project using the built-in IDE tools.

Now try debugging your project again. If that still fails, try running your project in a new workspace. Not sure about Netbeans, but with Intellij and Eclipse, there are project files that can go into a bad state.

0
votes

Thanks for your answers guys!

It worked again after clean and build and Tomcat restart. By the way, we found out that JavaScript can't be debugged whereas regular Java sources does.