Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Solution 1:
Cause: The error occurred since hibernate is not able to connect to the database.
Solution:
1. Please ensure that you have a database present at the server referred to in the configuration file eg. "hibernatedb" in this case.
2. Please see if the username and password for connecting to the db are correct.
3. Check if relevant jars required for the connection are mapped to the project.
Solution 2:
You don't need hibernate-entitymanager-xxx.jar
, because of you use a Hibernate session approach (not JPA
). You need to close the SessionFactory
too and rollback a transaction on errors. But, the problem, of course, is not with those.
This is returned by a database
#
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "sa"
#
Looks like you've provided an incorrect username or (and) password.