Okay, let me start of with stating that I am probably doing something wrong here, but yesterday I was amazed by the speed of Sun AS 9.
I'm working on a backend system that uses JPA, and connects with a MIDlet, or rather, at the moment the MIDlet is connecting with the backend. But that's not the issue today. The backend has a daemon running (a thread in the web tier) started by a servlet that generates a data-structure and expands it over time. Because I wanted this to be started at server startup, the thread was started in the servlet's overridden init() method. Because I wasn't sure whether or not my code was working, I set a breakpoint in the init() and started debugging. Guess what, nothing happened, the breakpoint was never hit! Adding some System.outs in the init() showed that it was called, NB's debugger was just never ready to stop on the breakpoint. It seems to be too slow, or the interaction between Sun AS and NB is not synched correctly.
So now I moved the code to the doGet and I kick off the thread in there. It all works nicely and my code works like a charm. And I can debug the code.
So what is going on? I tried several scenario's each time ensuring that I did a clean-build prior to my trial.
Scenario 1: Start my web app from NetBeans by hitting the debug button. Breakpoint in init() didn't pause the app.
Scenario 2: Start Sun AS in NetBeans in debug mode. Breakpoint in init() didn't pause the app.
Scenario 3: Start Sun AS in debug mode and start my web app from NetBeans by hitting the debug button. Breakpoint in init() didn't pause the app.
In all three scenario's the breakpoint in doGet() worked perfectly. Really weird, but at least after a lot of trial and restart of NB it worked, some way.