*
The moose likes Threads and Synchronization and the fly likes illegal access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "illegal access" Watch "illegal access" New topic
Author

illegal access

J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 853
    
  13

Still trying to get this weather service to run on fixed intervals. I finally have this much working, it works great the first time. After 5 minutes it should refresh, but instead I get this message:

Jul 19, 2012 2:04:23 PM com.gy.dan.jkr.WeatherListener contextInitialized
INFO: WeatherListener:Context initialized
Jul 19, 2012 2:04:23 PM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information
Jul 19, 2012 2:09:21 PM org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load weather.properties. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
Jul 19, 2012 2:09:24 PM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information
Jul 19, 2012 2:14:27 PM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information

You can see the run at 2:14 worked okay, so why the odd message on the 2:09 run?

I never do get a stack trace, just this message. Here's the code:


I don't understand why it's reporting as stopped. This is my first attempt at using the ScheduleThreadPoolExecutor, so I don't pretend to know what I'm doing. I'm closing the inputStream and shutting down the connection manager. Am I missing something else that needs to be cleaned up between runs?


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 853
    
  13

I seem to have fixed the illegal access issue, along with the issue of Tomcat not shutting down correctly. But now I get this on shutdown:

INFO: Server startup in 7111 ms
Jul 20, 2012 7:52:23 AM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information
Jul 20, 2012 7:57:24 AM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information
Jul 20, 2012 8:02:26 AM com.gy.dan.jkr.WeatherListener$1 run
INFO: Updating weather information
Jul 20, 2012 8:05:06 AM org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jul 20, 2012 8:05:06 AM org.apache.coyote.ajp.AjpAprProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-8009
Jul 20, 2012 8:05:07 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:07 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [scheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:08 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [AS400 Read Daemon [system:134.200.200.28;job:669495/QUSER/QZDASOINIT]] but has failed to stop it. This is very likely to create a memory leak.
Jul 20, 2012 8:05:08 AM org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Jul 20, 2012 8:05:08 AM org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009

Any tips on how to get rid of those "scheduler_worker" errors?

Here's the latest version. I changed the scheduler to a static variable so I could get a reference to it in the contextDestroyed() method where I do a shutDownNow(). I must still be missing something else.


J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 853
    
  13

According to this it's not an issue, but I'm still not comfortable with this. Maybe this should be bounced over to the Tomcat forum if nobody here has any suggestions. I'm using Tomcat 6.0.26.

Excerpt:

"There is a ´╗┐memory leak detection feature introduced in Tomcat 6.0.25 that attempts to log objects that have failed to be unregistered by webapps it hosts when they are stopped, and were forcibly unregistered by Tomcat. As Tomcat is forcibly removing these objects, it is not a serious concern that these log messages occur.

These errors will also appear during startup if your JDBC driver is not in the correct location on startup. If you are using a datasource, be sure to copy the JDBC drive to <confluence-install>/lib. If the issue persists, verify that you are able to authenticate against your database with the credentials supplied in your <confluence-home>/confluence.cfg.xml in the Hibernate connection settings.

Despite their apparent severity, these log messages are benign and can be safely ignored."


I'd rather fix this by properly unregistering whatever is causing this issue. Hints?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: illegal access
 
Similar Threads
where to start with parsing XML
Issue with Spring OXM When Unmarshalling XML data(oxm:jaxb2-marshaller)
creating a task to run every hour
Manipulating static web pages to get dynamic results!
logging API in 1.4