• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

java.lang.IllegalStateException

 
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi greeting from vinoth....

I am developing a web application which needs to run a task every day at 5 pm. For example updating a table every day.

i am using the following code scheduler is a Class

public void start()
{
scheduler.schedule(new SchedulerTask()
{
public void run()
{
soundAlarm();
}
private void soundAlarm()
{
try
{

//this is the function which contains code to update table

general.CommonDataBase com_schedule = new general.CommonDataBase();
com_schedule.qtyCleanup();

System.out.println("Qty Cleaned up");
}catch(Exception e){}

}
}, new DailyIterator(hourOfDay, minute, second));
}


then i have created a servlet class and configured in web.xml

servlet code is here

public class ScheduleRunner implements Servlet
{
public void init(ServletConfig config) throws ServletException
{
MSchedule mschedule = new MSchedule(10, 06, 0);
mschedule.start();
}

public void service(ServletRequest request, ServletResponse response)throws ServletException, IOException
{ }

public void destroy()
{ }

public String getServletInfo() {
return null;
}
public ServletConfig getServletConfig() {
return null;
}
}


it works. But i get the following error message in tomcat

Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.lang.StringBuilder. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.<init>(CommonDataBase.java:64)
at Schedule.MSchedule$1.run(MSchedule.java:63)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.sql.Date. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.<init>(CommonDataBase.java:67)
at Schedule.MSchedule$1.run(MSchedule.java:63)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Driver. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at general.DBConnection.getConnect(DBConnection.java:18)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.lang.System. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.DBConnection.getConnect(DBConnection.java:25)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
Unable to connect to database.java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
INFO: Illegal access: this web application instance has been stopped already. Could not load java.io.PrintStream. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.DBConnection.getConnect(DBConnection.java:25)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
stock clean upjava.lang.NullPointerException
INFO: Illegal access: this web application instance has been stopped already. Could not load java.sql.Connection. 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.
Qty Cleaned up
java.lang.IllegalStateException
It's 12 Apr 2011 09:50:00.062 Now!
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1133)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Qty Cleaned up


why this error comes & any solution please....
 
Sheriff
Posts: 22810
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can clearly remember asking you to UseCodeTags before.
 
vinoth Robert
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok

hi greeting from vinoth....

I am developing a web application which needs to run a task every day at 5 pm. For example updating a table every day.

i am using the following code scheduler is a Class




then i have created a servlet class and configured in web.xml

servlet code is here



it works. But i get the following error message in tomcat

Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.lang.StringBuilder. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.<init>(CommonDataBase.java:64)
at Schedule.MSchedule$1.run(MSchedule.java:63)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.sql.Date. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.<init>(CommonDataBase.java:67)
at Schedule.MSchedule$1.run(MSchedule.java:63)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Driver. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at general.DBConnection.getConnect(DBConnection.java:18)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load java.lang.System. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.DBConnection.getConnect(DBConnection.java:25)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
Unable to connect to database.java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
INFO: Illegal access: this web application instance has been stopped already. Could not load java.io.PrintStream. 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.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.DBConnection.getConnect(DBConnection.java:25)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1130)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Apr 12, 2011 9:50:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
stock clean upjava.lang.NullPointerException
INFO: Illegal access: this web application instance has been stopped already. Could not load java.sql.Connection. 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.
Qty Cleaned up
java.lang.IllegalStateException
It's 12 Apr 2011 09:50:00.062 Now!
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at general.CommonDataBase.qtyCleanup(CommonDataBase.java:1133)
at Schedule.MSchedule$1.run(MSchedule.java:64)
at Schedule.Scheduler$SchedulerTimerTask.run(Scheduler.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Qty Cleaned up

why this error comes & any solution please....
 
Rob Spoor
Sheriff
Posts: 22810
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your timer / scheduler keeps running even though the web application has been stopped. Try stopping mschedule in the servlet's destroy() method.
 
That new kid is a freak. Show him this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic