Using the NetBeans 6 M10 profiler with Tomcat and Mac OS X
One of the (many) neat features of NetBeans, coming from older versions but improved in 6M10, is the integrated profiler. Since NetBeans comes also with an out-of-the-box integration with Tomcat (and other application servers), theoretically profiling your web applications should be just a matter of pushing two buttons.
But this didn't worked for me as I wasn't able to have Tomcat started in "profiling mode" - I always had error messages about the profiling agent not being found.
After some investigation I found out that the problem is... spaces in classpaths! It's a kind of problem that haunts Java since the inception, and it's still here!
Well, my NetBeans 6 M10 got installed in a directory named:
and you see there's that space after NetBeans. First, I removed it to have:
Second, inside that directory there is other stuff, of course. The real set of NetBeans files is in:
because of the Mac OS X application bundle structure. You see that other space after NetBeans. So I removed it to have:
There's a final step to perform: there are a couple of symbolic links that still point to the old path with the spaces:
I fixed them and now... my Tomcat profiler just runs in a matter of a couple of mouse clicks!
While some parts of that stuff are Mac OS X related, indeed the same problem could be found on other operating systems (I didn't tried them yet). What's your experience?