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 9016959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:08:23+00:00 2026-06-16T04:08:23+00:00

My simple web-app sometimes crashes when navigating around the site, the error message I’ve

  • 0

My simple web-app sometimes crashes when navigating around the site, the error message I’ve gotten from the logs are found below. I have absolutely no idea of what is causing this and would be very thankful for any tips that’ll lead me in the right direction.

HTTP Status 500 - org.hibernate.exception.JDBCConnectionException: Cannot open connection

type Exception report

message org.hibernate.exception.JDBCConnectionException: Cannot open connection

description The server encountered an internal error that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

root cause

org.hibernate.exception.JDBCConnectionException: Cannot open connection
    org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
    org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
    org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
    org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
    org.hibernate.loader.Loader.doQuery(Loader.java:696)
    org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    org.hibernate.loader.Loader.doList(Loader.java:2228)
    org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    org.hibernate.loader.Loader.list(Loader.java:2120)
    org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
    org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
    com.html.XmlSetting.getListOfhtml_connect(XmlSetting.java:55)
    com.html.XmlSetting.removeXml(XmlSetting.java:121)
    com.html.MarginSetting.removeXml(MarginSetting.java:291)
    org.apache.jsp.check_jsp._jspService(check_jsp.java:183)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

root cause

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections
    sun.reflect.GeneratedConstructorAccessor153.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    com.mysql.jdbc.Util.getInstance(Util.java:381)
    com.mysql.jdbc.SQLError.createSQLException(SQLError.java:985)
    com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:894)
    com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3808)
    com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1256)
    com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2032)
    com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729)
    com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
    sun.reflect.GeneratedConstructorAccessor145.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283)
    java.sql.DriverManager.getConnection(DriverManager.java:620)
    java.sql.DriverManager.getConnection(DriverManager.java:169)
    org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
    org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
    org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
    org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
    org.hibernate.loader.Loader.doQuery(Loader.java:696)
    org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    org.hibernate.loader.Loader.doList(Loader.java:2228)
    org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    org.hibernate.loader.Loader.list(Loader.java:2120)
    org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
    org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
    com.html.XmlSetting.getListOfhtml_connect(XmlSetting.java:55)
    com.html.XmlSetting.removeXml(XmlSetting.java:121)
    com.html.MarginSetting.removeXml(MarginSetting.java:291)
    org.apache.jsp.check_jsp._jspService(check_jsp.java:183)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

I m using Apache Tomcat 7

hibernate.cfg.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>

        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/htmlcleaner</property>
        <property name="hibernate.connection.password">root</property>
        <property name="hibernate.connection.username">root</property>

        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>

        <property name="connection.pool_size">1000</property>

       <!--  <property name="show_sql">true</property> -->
        <mapping class="com.model.html_connect"/>

    </session-factory>
</hibernate-configuration>
  • 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-06-16T04:08:27+00:00Added an answer on June 16, 2026 at 4:08 am

    It looks like you are leaking connections big time. Are you closing your hibernate sessions when you are done with them?

    You could also try and fiddle about with hibernate.connection.release_mode , by default, this is set to auto and it will release the connection when you close the session. However, you also have the options here to use after_transaction or after_statement (its rather self explanatory when it will release the connections for each of the two :P).

    With that said though, you do need to find out where you leaks are 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple web app/form using google app engine. the site is
I have a fairly simple android app, it gets protobuf data from a web
Ok so I'm making a simple web app using the technologies from the topic,
I want to create a simple web app that will have a connection from
I am creating a simple web app. There is a <video> element on the
I'm writing a simple web app in PHP that needs to have write access
I have a simple web app with users and posts. I have an index
I have a simple web app built in asp.net webforms c# where and how
I have a simple web app: a web page with a form to submit,
So I have a simple web app where I can create a user (UserModel)

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.