Meaningless Drivel is fun!*
The moose likes JSP and the fly likes When does java.lang.IllegalStateException occur? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "When does java.lang.IllegalStateException occur?" Watch "When does java.lang.IllegalStateException occur?" New topic
Author

When does java.lang.IllegalStateException occur?

viki Bhardwaj
Ranch Hand

Joined: Nov 07, 2011
Posts: 74

I am working on the project on jsp,servlet and database using mysql when i deploy the project then i found java.lang.IllegalStateException this exception. but i am unable to trace that why it occuring and where i m missing something..Exceptions are as bellow:


org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException. 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:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4564)
at com.ibatis.common.jdbc.SimpleDataSource.forceCloseAll(SimpleDataSource.java:505)
at com.ibatis.common.jdbc.SimpleDataSource.finalize(SimpleDataSource.java:738)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)


Please suggest me with possible reasons:
Pyla Rao
Ranch Hand

Joined: Jul 10, 2012
Posts: 50
The Java Illegal state exception states that you are attempting writing out put stream after response has been committed.
For solving this problem including return statement immediately after send redirect or forward statement.
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
You can read it here


Programming is about thinking, NOT coding
viki Bhardwaj
Ranch Hand

Joined: Nov 07, 2011
Posts: 74

thanks to all of you
for your valuable reply.
 
 
subject: When does java.lang.IllegalStateException occur?
 
Similar Threads
Illegal access: this web application instance has been stopped already.
java.lang.IllegalStateException
Could not load java.net.BindException.
Netbeans & Tomcat Problem : Error messages included!
Could not load com.mysql.jdbc.SQLError