Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When does java.lang.IllegalStateException occur?

 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 179
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read it here
 
viki Bhardwaj
Ranch Hand
Posts: 74
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks to all of you
for your valuable reply.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic