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.
Running the daily build from 2007-08-21 on Ubuntu 7.04 with JDK6u2 I used the entry for Tomcat that is in the Services window to start Tomcat. That worked fine. Then I used it again to try to stop Tomcat. The IDE timed out and eventually reported that it was unable to stop Tomcat. Using jps, however, it appears that Tomcat is no longer running. So Tomcat did apparently get stopped (I have seen this happen before with this build, however, and Tomcat did *not* get stopped). I will attach my message log. Are there any logging messages that I could turn on to get additional information?
Created attachment 46998 [details] message log file
I can't reproduce the issue. Marking as INCOMPLETE. 1) Can you please attach Tomcat server output and server log? 2) Is the issue always reproducible? 3) What is deployed on the server? In order to enabled debug logging just start NetBeans with the following parameter: -J-Dorg.netbeans.modules.tomcat5.level=0
This is, unfortunately, not consistently reproducible. I tried just now to start and stop Tomcat a few times with no applications deployed. It worked perfectly each time. Then I deployed the Roller web log engine (you can get the project from here: http://wiki.netbeans.org/wiki/view/RollerCaseStudy, with complete setup instructions) and was able to reproduce the problem. I started Tomcat by right-clicking the Roller project and choosing Run. After Tomcat started I went to the Resources window and shut down Tomcat. The IDE eventually timed out and reported that it was unable to stop Tomcat. Interestingly, it appears that Tomcat is in fact still running. When I run jps I see this entry: 12732 Bootstrap Isn't Bootstrap the name of the main class for Tomcat? When I try to access localhost:8084 in my browser, however, I get an "Unable to Connect error".... The Tomcat server output as displayed in the IDE's output window is: Aug 22, 2007 10:55:12 AM org.apache.catalina.core.AprLifecycleListener init INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/share/jdk1.6.0_02/jre/lib/i386/client:/usr/share/jdk1.6.0_02/jre/lib/i386:/usr/share/jdk1.6.0_02/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib Aug 22, 2007 10:55:12 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8084 Aug 22, 2007 10:55:12 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 506 ms Aug 22, 2007 10:55:12 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 22, 2007 10:55:12 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.13 AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1bbd23f) LogAbandoned: false RemoveAbandoned: true RemoveAbandonedTimeout: 300 Aug 22, 2007 10:55:17 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8084 Aug 22, 2007 10:55:17 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 22, 2007 10:55:17 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/52 config=null Aug 22, 2007 10:55:17 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 5371 ms Aug 22, 2007 10:55:23 AM org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8084 Aug 22, 2007 10:55:24 AM org.apache.catalina.core.StandardService stop INFO: Stopping service Catalina Aug 22, 2007 10:55:24 AM org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8084 I will attach the requested files.
Created attachment 47090 [details] IDE's message log file
Created attachment 47093 [details] Tomcat log files
The application seems to be rather big. So far, it does not seem to me that the problem is in NetBeans. Based on the provided log files, Tomcat plugin correctly launched 'catalina.sh stop' script and then waited for a few minutes whether the server shut down or not. Could you please check whether the same issue occurs when you try to stop Tomcat from the command line? Set the CATALINA_HOME and CATALINA_BASE environment variables according to the values from the server manager and call 'catalina.sh stop'. It might be also interesting to see Tomcat thread dump after an unsuccessful attempt to stop the server. Use 'ps -Af | grep Bootstrap' command to find the Tomcat process and then use 'kill -QUIT $PID' to generate a thread dump. The thread dump should appear in the server output. Thanks
Can be reproduced from command line too (with different jvms). It seems that when tomcat is running this application it performs some other tasks after the start. This tasks (don't know exactly what is happening) probably delays the stop by almost 5 minutes. When the tomcat is left running for some time and _after_ that the stop is executed it finishes immediately.
Created attachment 49003 [details] thread dump - stopping tomcat
Tomcat without this application works pretty fine. It is almost certain that the trouble is caused by the application. Maybe jdbc driver or something similar. Will investigate a bit more, however it is almost certain that this issue will be closed as invalid.
The problem is in the user application in class ThreadManagerImpl. It is probably the following code which blocks the shutdown: public void shutdown() { backgroundExecutor.shutdownAfterProcessingCurrentlyQueuedTasks(); scheduler.cancel(); } When changed to use backgroundExecutor.shutdownNow() tomcat shutdowns immediately. Definitely not a netbeans issue.