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.
Netbeans does this: 1. Launch tomcat pointing to my WAR file 2. Attach to tomcat for debugging/control 3. Un-load my WAR file 3. Re-load my WAR file What it should do: 1. Launch tomcat empty 2. Attach to tomcat 3. Load my WAR file This takes twice as long because my WAR file has a relatively long initialization while it loads Spring and Hibernate. Also, my WAR file starts a background thread that looks for work, and this thread doesn't particularly like being started for two seconds and then closed.
I am using Maven
I do not think this has anything to do with debugger, specifically. It looks like this is more about the build/run script.
Does not sound like a Maven issue --> reassigning to Tomcat for evaluation
(In reply to almson from comment #0) > Netbeans does this: > 1. Launch tomcat pointing to my WAR file > 2. Attach to tomcat for debugging/control > 3. Un-load my WAR file > 3. Re-load my WAR file > > What it should do: > 1. Launch tomcat empty > 2. Attach to tomcat > 3. Load my WAR file > > This takes twice as long because my WAR file has a relatively long > initialization while it loads Spring and Hibernate. Also, my WAR file starts > a background thread that looks for work, and this thread doesn't > particularly like being started for two seconds and then closed. Please provide exact steps to reproduce and expected results. These are too brief and fuzzy. The first scenario make sense if the app has been deployed previously. Otherwise I do not know what this means: Launch tomcat pointing to my WAR file
I meant that Tomcat is configured (via xml file, I believe) to load the application as soon it is started. After it starts and loads the application, however, it is intructed to unload and reload it. Of you need a sample project, I will provide it. But this behavior should be the same for all projects.
I've noticed this behavior happens when my webapp loads before the manager. Then once the manager loads my app is undeployed and redeployed (which makes sense). As a workaround I make sure the manager loads first by renaming the manager.xml deployment descriptor such that it sorts alphabetically before my webapp: cd ${CATALINA_BASE}/conf/Catalina/localhost mv manager.xml +manager.xml It might be worth making this change (renaming the manager.xml file to +manager.xml) in the NetBeans distribution.
It seems I spoke too soon with my previous comment. Changing manager.xml to +manager.xml does properly control the load order but because of the fact that Tomcat assigns the context path from the deployment descriptor filename the manager then lives at /+manager/ which breaks debugging. The Context path attribute is unfortunately ignored in a deployment descriptor. Maybe I should file a bug on that, using the filename to both name the webapp *and* control the load order as Tomcat does currently is really asking too much. The filename should be allowed to control load order while the Context path should still be assignable by an administrator. The thing I'll try next is to rename all my webapps to something alphabetically behind "manager". Not the best solution.