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

  • Home
  • SEARCH
  • 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 853415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:45:18+00:00 2026-05-15T07:45:18+00:00

I write an Test Java APP and it works right BUt this Web app

  • 0

I write an Test Java APP and it works right BUt this Web app throws an exception like that with to same cfg.xml file

<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.autocommit">true</property>
<property name="hibernate.connection.release_mode">auto</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">1234</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost/postgres</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.default_schema">public</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>

<property name="hibernate.ejb.discard_pc_on_close">false</property>
<property name="hibernate.query.jpaql_strict_compliance">true</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.transaction.flush_before_completion">false</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.generate_statistics">false</property>
<property name="hibernate.use_sql_comments">false</property>
<property name="hibernate.connection.pool_size">100</property>

When I press “Save” button I get the following exception:

javax.servlet.ServletException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)

root cause

javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
 javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
 javax.faces.component.UICommand.broadcast(UICommand.java:315)
 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

root cause

org.hibernate.exception.JDBCConnectionException: Cannot open connection
 org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:98)
 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.JDBCContext.connection(JDBCContext.java:142)
 org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
 org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 java.lang.reflect.Method.invoke(Unknown Source)
 org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
 $Proxy108.beginTransaction(Unknown Source)
 com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 java.lang.reflect.Method.invoke(Unknown Source)
 org.apache.el.parser.AstValue.invoke(AstValue.java:196)
 org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
 com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
 javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
 javax.faces.component.UICommand.broadcast(UICommand.java:315)
 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

root cause

java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/postgres
 java.sql.DriverManager.getConnection(Unknown Source)
 java.sql.DriverManager.getConnection(Unknown Source)
 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.JDBCContext.connection(JDBCContext.java:142)
 org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
 org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 java.lang.reflect.Method.invoke(Unknown Source)
 org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
 $Proxy108.beginTransaction(Unknown Source)
 com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 java.lang.reflect.Method.invoke(Unknown Source)
 org.apache.el.parser.AstValue.invoke(AstValue.java:196)
 org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
 com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
 javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
 com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
 javax.faces.component.UICommand.broadcast(UICommand.java:315)
 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
 javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
 com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

Blockquote

  • 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-15T07:45:19+00:00Added an answer on May 15, 2026 at 7:45 am

    What’s the question here?

    The exception is pretty explicit:

    org.hibernate.exception.JDBCConnectionException: Cannot open connection

    Make sure you can connect to the database you are connected to, that the configuration is correct, that you do not have network issues preventing the connection, etc.

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're correct on both problems, though they're really both the… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer You could try building the queries for each subclass individually,… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer Overriding DefaultAutomappingConfiguration might help. Something like this might work :… May 16, 2026 at 3:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to write test cases for my web services in a way that
Ruby 1.9.1, OSX 10.5.8 I'm trying to write a simple app that parses through
I need to write a Perl script that pipes input into a Java program.
I am trying to write a unit test using .NET 4 to ensure that
I am using this code to write to a file in java. it has
I wrote servlet that writes an image to the root directory of my app
I am using hudson CI to manage a straight java web project, using ant
I wrote a little Java servlet that would dynamically generate an image button given
I am writing a web application that will serve as a configuration for a
I have been using Selenium a lot lately (testing an ExtJs app) and while

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.