I want to give you a couple of options. You can try. Any option can satisfy your requirement.
Restart your tomcat and apache server , because for a long time, it stores an older version of your application.- Empty the tomcat
temp and restart directory - As indicated by mistake ,
A possible next stack trace is caused by an error caused by debugging, and also try to close the thread that caused illegal access and has no functional impact.
This may be the real reason that you are currently in debug mode and it does not clear the current thread. so remove the breakpoint and run it without debugging
If your code contains any thread that has not been properly terminated, this type of error may occur. You have an init() method, but not a destroy() method, then this type of error may occur. For more information, you can follow the link - http://www.javaspecialists.eu/archive/Issue056.html
if webapp has stopped, or is stopping , it means that the timestamp .war or WEB-INF/web.xml been changed and webapp can be reloaded. Please mark the time stamp is normal or not.
To disable it, set reloadable = "false" in the context of your application definition. It could be tomcat server.xml . Detailed solution: The tomcat server.xml file of the reloadable context is set to false. For instance:
Context path = "/ expert" docBase = "expert" debug = "0" reloadable = "false" />
The solution is easy if tomcat server.xml in reloadable = "true" into false on the line, but for this it will lose the advantage of hot deployment, and for development it is not very convenient, just change it or not. This error does not matter.
The principle of error:
The reason is that tomcat rebooted because the previous tomcat thread did not shut down completely, restart tomcat will report this exception, but this does not affect normal use, just jump over abnormal annoying people. Used by hibernate, spring or other large components when the WEB application system has many classes,
if you enabled Tomcat reloadable = true , then whenever the relevant documents change, Tomcat stops the web application and frees up memory, and then restarts the web application. it can be a huge project. Therefore, we always think that there is only a certain class of overloaded functions that largely correspond to our debugger.
UPDATE: for code issue
Firstly, I want to tell you that I have given you some solutions for the tomcat framework. Now I want to give you a solution for the code . Could you double-check your code with this problem? Follow the url.
- http://www.coderanch.com/t/660126/Wiki/Illegal-State-Exception
UPDATE: for MySQL related issue
There are 2 problems.
This is due to the fact that the MySQL JDBC driver in the application in the WEB-INF/lib , when re-released it is loaded twice, if it can be copied to %TOMCAT_HOME%/lib , can solve the problem. We can solve these two MySQL driver anomalies from the WEB-INF/lib folder, migrated to %TOMCAT_HOME%/lib .
- I suspect this may happen after restarting the web application, where it will run for a short period of time. Then some
finalize() method in the code is probably trying to do some cleanup too late. No matter what I can say in the code or in the MySQL driver. You should definitely have only one version of the jar in the catalog at a time. You might want to update it to last (5.1.38 right now) in case something has been fixed that might affect you. (Number 9 copied from @ WhiteFang34)
Related link for 9: tomcat 6.0.24 Exception: Could not load com.mysql.jdbc.SQLError