[cron4j::scheduler[379fb3d143dcc7b501056bdd00000160b29120e167bf974a]::launcher[379fb3d143dcc7b55032f2b700000160c2fdc861001a785c]] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [it.sauronsoftware.cron4j.TaskTable]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [it.sauronsoftware.cron4j.TaskTable]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1355) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1341) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1206) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at it.sauronsoftware.cron4j.MemoryTaskCollector.getTasks(Unknown Source) at it.sauronsoftware.cron4j.LauncherThread.run(Unknown Source) Exception in thread "cron4j::scheduler[379fb3d143dcc7b501056bdd00000160b29120e167bf974a]::launcher[379fb3d143dcc7b55032f2b700000160c2fdc861001a785c]" java.lang.IllegalStateException: Can't overwrite cause with java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [it.sauronsoftware.cron4j.TaskTable]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. at java.lang.Throwable.initCause(Throwable.java:456) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1344) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1206) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at it.sauronsoftware.cron4j.MemoryTaskCollector.getTasks(Unknown Source) at it.sauronsoftware.cron4j.LauncherThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1343) ... 4 more
jfinal 配置:
cp = ()cp.addTask(MyTask())me.add(cp)
java.text.SimpleDateFormatjava.util.DateMyTask Runnable { () { SimpleDateFormat sdf=SimpleDateFormat()String time=sdf.format(Date())System..println(time)} }
在本地用jetty和tomcat运行都正常,到服务器tomcat就出上面的错误。
项目:JFinal
cp.addTask("*/1 * * * *", new MyTask());
me.add(cp);