visan / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Timer already cancelled Exception #456

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Restart tomcat
2. Go to my webapp's /monitoring page
3. This is in my stack trace

What is the expected output? What do you see instead?

The graphs stopped working (I get the broken image icon). The 
domain.com:8080/javamelody-1.55.0 seems to still be working though.

Stack-trace
java.lang.IllegalStateException: Timer already cancelled.
      at java.util.Timer.sched(Timer.java:397)
      at java.util.Timer.schedule(Timer.java:248)
      at net.bull.javamelody.RrdNioBackend.<init>(RrdNioBackend.java:66)
      at net.bull.javamelody.RrdNioBackendFactory.open(RrdNioBackendFactory.java:84)
      at org.jrobin.core.RrdDb.<init>(Unknown Source)
      at org.jrobin.core.RrdDb.<init>(Unknown Source)
      at org.jrobin.core.RrdDb.<init>(Unknown Source)
      at org.jrobin.core.RrdDbPool.requestRrdDb(Unknown Source)
      at org.jrobin.data.DataProcessor.getRrd(Unknown Source)
      at org.jrobin.data.DataProcessor.fetchRrdData(Unknown Source)
      at org.jrobin.data.DataProcessor.processData(Unknown Source)
      at org.jrobin.graph.RrdGraph.fetchData(Unknown Source)
      at org.jrobin.graph.RrdGraph.createGraph(Unknown Source)
      at org.jrobin.graph.RrdGraph.<init>(Unknown Source)
      at net.bull.javamelody.JRobin.graph(JRobin.java:203)
      at net.bull.javamelody.MonitoringController.doGraph(MonitoringController.java:365)
      at net.bull.javamelody.MonitoringController.doReport(MonitoringController.java:176)
      at net.bull.javamelody.MonitoringController.doActionIfNeededAndReport(MonitoringController.java:147)
      at net.bull.javamelody.MonitoringFilter.doMonitoring(MonitoringFilter.java:340)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:167)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:744)

What version of the product are you using? On what application server, JDK,
operating system?

javamelody 1.55
Tomcat 7.0.54
java version "1.7.0_51"

Please provide any additional information below.

The problem might have started when clicking "View memory histogram" gave me an 
error.

Here's a debugging log:

Fri Jan 30 10:18:31 PST 2015     DEBUG     JavaMelody listener init started
Fri Jan 30 10:18:31 PST 2015     DEBUG     datasources found in JNDI: []
Fri Jan 30 10:18:31 PST 2015     DEBUG     JavaMelody listener init done in 11 
ms
Fri Jan 30 10:18:31 PST 2015     DEBUG     JavaMelody filter init started
Fri Jan 30 10:18:31 PST 2015     DEBUG     OS: Mac OS X unknown, x86_64/64
Fri Jan 30 10:18:31 PST 2015     DEBUG     Java: Java(TM) SE Runtime 
Environment, 1.7.0_51-b13
Fri Jan 30 10:18:31 PST 2015     DEBUG     Server: Apache Tomcat/7.0.54
Fri Jan 30 10:18:31 PST 2015     DEBUG     Webapp context: 
Fri Jan 30 10:18:31 PST 2015     DEBUG     JavaMelody version: 1.55.0
Fri Jan 30 10:18:31 PST 2015     DEBUG     JavaMelody classes loaded from: 
file:/usr/local/apache-tomcat-7.0.54/webapps/ROOT/WEB-INF/lib/javamelody.jar
Fri Jan 30 10:18:31 PST 2015     DEBUG     Host: domain.com@192.168.1.1
Fri Jan 30 10:18:31 PST 2015     DEBUG     log listeners initialized
Fri Jan 30 10:18:31 PST 2015     DEBUG     datasources found in JNDI: []
Fri Jan 30 10:18:31 PST 2015     DEBUG     counters initialized
Fri Jan 30 10:18:31 PST 2015     DEBUG     counters data read from files in 
/usr/local/apache-tomcat-7.0.54/temp/javamelody/_domain.com
Fri Jan 30 10:18:31 PST 2015     DEBUG     collect task scheduled every 60s
Fri Jan 30 10:18:32 PST 2015     DEBUG     first collect of data done
Fri Jan 30 10:18:32 PST 2015     DEBUG     JavaMelody filter init done in 109 ms
Fri Jan 30 10:18:46 PST 2015     DEBUG     Stopping the javamelody collector in 
this webapp, because a collector server from 192.168.1.1 wants to collect the 
data itself
Fri Jan 30 10:19:08 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:19:14 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:09 PST 2015     DEBUG     Action 'CLEAR_COUNTER' executed. 
Result: Statistics log cleared.
Fri Jan 30 10:21:09 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:16 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:31 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:31 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:34 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:21:40 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:22:57 PST 2015     WARN     heaphisto report failed
Fri Jan 30 10:23:00 PST 2015     WARN     exception while collecting data
Fri Jan 30 10:23:07 PST 2015     WARN     exception while collecting data

Original issue reported on code.google.com by nitroa...@gmail.com on 30 Jan 2015 at 6:32

GoogleCodeExporter commented 9 years ago
It seems that you use the optional collect server documented at:
https://code.google.com/p/javamelody/wiki/UserGuideAdvanced#Optional_centralizat
ion_server_setup

Note that using the collect server is optional and is not recommended in the 
general case: the monitoring in the webapp is generally enough. Moreover in 
your case, you have installed the collect server on the same server that the 
monitored webapp ; there is no added value to use the collect server in this 
case, because you have increased cpu and memory used instead of decreasing them.

Your issue is that you are trying to display the monitoring page of the webapp 
to get reports, instead of the page of the collect server.

Make a choice and do not use this monitoring page if you use the optional 
collector server: either use the monitoring page from the webapp (remove the 
collector server and restart the webapp), or use the page from the collector 
server.

But I have one question please:
What in the documentation have made you think that you should install a collect 
server?
(I should probably fix that whatever it was)

Original comment by evernat@free.fr on 1 Feb 2015 at 4:17

GoogleCodeExporter commented 9 years ago
Thanks for your help. I deleted the collect server and restarted Tomcat and it 
looks like the problems have gone away.

In terms of documentation, here's how I ended up with this install. I had been 
googling for tools like this, and I think I first saw Javamelody mentioned in a 
Stackoverflow comment (I couldn't find it again) as having a feature of easy 
installation as a war file. So I went to your releases page, saw the war file 
there, and installed that. I mistakenly interpreted "optional" as meaning "hey, 
here's a convenient installation option" instead of "this is a non-standard 
alternative". I went to the collect server page and I think I tried to enter 
something in the fields, but it didn't work, so then I went to the user 
installation guide. It was then I learned about the individual jar files, so I 
installed those. But now I found the warning in your advanced user's guide 
about the incompatibility.

My recommendation would be to copy the incompatibility remark in one or both of 
these places:
https://code.google.com/p/javamelody/wiki/UserGuide#Setup
https://github.com/javamelody/javamelody/releases

Thanks for the great tool!

Original comment by nitroa...@gmail.com on 2 Feb 2015 at 5:53

GoogleCodeExporter commented 9 years ago
I have updated both places:
https://code.google.com/p/javamelody/wiki/UserGuide#Setup
https://github.com/javamelody/javamelody/releases

thank you

Original comment by evernat@free.fr on 5 Feb 2015 at 1:10