This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If your webapp has a Servlet class with an init() hook method and <load-on-startup> is specified, you cannot (easily) debug stuff inside init(). My team is new to Netbeans but I'm surprised nobody has filed this issue yet. If the above jargon does not make sense you can reproduce the problem by following the steps for issue #129968 and putting a breakpoint in the init() method you added. The debugger won't stop on it. I believe the issue is simply because the debugger does not attach until AFTER Tomcat has finished startup, which is too late for Servlets that specify <load-on-startup> in web.xml. There are a couple workarounds (neither of which work well for my team): 1) Put a Thread.sleep() in the init() code you wish to debug and manually attach the debugger while it's sleeping. 2) Remove <load-on-startup> from web.xml for your Servlet. Accessing the servlet URL in your browser will then trigger initialization. The reason these workarounds don't work well is: * It's not intuitive. (My team members keep complaining at me that it was so effortless in JBuilder) * You have to remember to take out the Thread.sleep() call or restore <load-on-startup> in web.xml before you commit your code. * #1 requires precise timing that is hard to muster in the later hours of a long day of programming.
There is a workaround: 1) Start tomcat in debug mode 2) Attach debugger 3) _Run_ the app again and again - it will hit the breakpoint Note you don't need to start-stop-start-stop... the tomcat when you are developing the application.
Brilliant! Thanks for setting us straight, phejl. I guess JBuilder had just trained us to restart Tomcat upon every change. That should relieve 90% of our frustration although I'm still curious why it does this sort of double start of the webapp that I described.
There is no justification for this being P2. Probably changed accidentaly... For the web app started twice - see my comment at the issue 129968.