Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:05:10+00:00 2026-05-24T20:05:10+00:00

I am developing an application with GWT, Hibernate (XML based mapping), MySQL- in Tomcat6.0.

  • 0

I am developing an application with GWT, Hibernate (XML based mapping), MySQL- in Tomcat6.0. IDE- Netbeans 6.9
I set the project properties “Deploy On Save” option in Netbeans.

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

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: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)  

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:05:13+00:00Added an answer on May 24, 2026 at 8:05 pm

    You are probably opening more and more connections and never closing them, eventually reaching your database’s configured maximum connection count.

    Find where you are opening connections and make sure you are closing them. If you open a connection for every request but don’t close it, that’s easy to find and fix. Or you might not be closing you connection when you get an error – check your exception handling code.

    The recommended approach when using DB connections is to use a try finally to make a best effort at closing db connections:

    Connection con;
    try {
       con = ...; // open connection
       // do work
    catch (SQLException e) {
       // do whatever
    } finally {
        if (con != null && !con.isClosed()) {
            try {
                con.close();
            catch (SQLException e) {
                // Don't throw from here or you'll lose any return/exception from above
                log.error("Failed to close connection", e);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing application based on the NetBeans platform. I use Maven to build
I am developing an application which interconnects GWT and Hibernate. From GWT server side
I am developing web based application in Java [GWT] I am facing problem with
I'm developing application with GWT 2 and would like to add float panel that
I'm currently in the process of developing a GWT 1.7.1 application that deals with
I am developing an application in GWT which needs to call a native C++
I'm develping a GWT application with Ebean. When I deploy it to my Tomcat
I am developing a web based application to replace a desktop based one. I
I am developing an application in GWT as my Bachelor's Thesis and I am
Greetings, I am developing GWT application where user can enter his details in Japanese.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.