title: Illegal access: this web application instance has been stopped already
body: <p>I am developing an application with GWT, <a href="https://zgrepcode.com/examples/hibernate-orm/" rel="nofollow noreferrer">Hibernate</a> (XML based mapping), MySQL- in Tomcat6.0. IDE- Netbeans 6.9 
  I set the project properties "Deploy On Save" option in Netbeans. </p>
  
  <p>When my application is running for long time in server every now and then my application fails to connect to database and throws the following exception</p>
  
  <p>The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread<br>
  which caused the illegal access, and has no functional impact.  </p>
  
  <pre><code>java.lang.IllegalStateException  
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)  
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)  
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)  
          at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4273)  
          at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1444)  
          at org.hibernate.connection.DriverManagerConnectionProvider.close(DriverManagerConnectionProvider.java:152)  
          at org.hibernate.connection.DriverManagerConnectionProvider.finalize(DriverManagerConnectionProvider.java:142)  
          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)  
  </code></pre>
  
  <p>When I restart my tomcat server I am again able to connect the Database.Please tell me the way through which I can get seamless performance and can get the work done without restarting the tomcat.</p>