java - Illegal access: this web application instance has been stopped already -
hi have class has init-method defined in xml
<bean id="appstarter" class="com.myapp.myclass" init-method="init" destroy-method="destroy"/>
myclass:
public class myclass{ private thread t; public void init() { t = new thread() { @override public void run() { while (true) try { dostuff(); thread.sleep(1000); } catch (exception e) { e.printstacktrace(); } } }; t.start(); } public void destroy() { t.interrupt(); } }
when app starts threads runs fine, , works fine , after sometime got following exception
info: illegal access: web application instance has been stopped already. not load com.sun.mail.imap.imapstore. eventual following stack trace caused error thrown debugging purposes attempt terminate thread caused illegal access, , has no functional impact. java.lang.illegalstateexception @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1273) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1233) @ javax.mail.session.getservice(session.java:755) @ javax.mail.session.getstore(session.java:569) @ javax.mail.session.getstore(session.java:531) @ javax.mail.session.getstore(session.java:510)
in dostuff method:
public void dostuff(){ session sessioned = session.getdefaultinstance(system.getproperties(), null); store store = sessioned.getstore("imap"); store.connect(hostname, username, password); . . . }
i don't know why, ideas ?
problem solved after restarting tomcat , apache, tomcat caching older version of app.
Comments
Post a Comment