# Unable to create requested service \[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment\]

**URL:** <https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695>\
**Category:** Hibernate Tools\
**Created:** [October 25, 2020, 2:21pm UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695 "2020-10-25T14:21:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leviosa19](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@leviosa19](https://discourse.hibernate.org/u/leviosa19)\
**Post date:** [October 25, 2020, 2:21pm UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695/1 "2020-10-25T14:21:22Z")

</div>

**ERROR:**

> Oct 25, 2020 7:40:55 PM org.hibernate.Version logVersion  
> INFO: HHH000412: Hibernate Core {5.4.9.Final}  
> Oct 25, 2020 7:40:56 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager   
> INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final}  
> Oct 25, 2020 7:40:57 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure  
> WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)  
> org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

**Servlet File**

```auto
String title = request.getParameter("title");
String content = request.getParameter("content");
			
Configuration cfg = new Configuration().configure();
SessionFactory sf = cfg.buildSessionFactory();
Session session = sf.openSession();
Transaction transaction = session.beginTransaction();
Note note = new Note(title, content, new Date());
session.save(note);
transaction.commit();
System.out.println("Record inserted");
System.out.println(note);
session.close();

```

**hibernate.cfg.xml**

```auto
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:rushi</property>
<property name="hibernate.connection.username">system</property>
<property name="hibernate.connection.password">rushi</property>
        
<property name="hbm2ddl.auto">create-drop</property>
<property name="show_sql">true</property>
<property name="hibernate.format_sql">true</property>

<mapping class="com.entities.Note"/>

```

**Please help to resolve this issue**

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [November 4, 2020, 5:43pm UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695/2 "2020-11-04T17:43:57Z")

</div>

You didn’t post what kind of environment you are running in, but I assume it’s a custom one or Tomcat/Jetty? You should configure a connection pool like described here: [https://docs.jboss.org/hibernate/stable/orm/userguide/html\_single/Hibernate\_User\_Guide.html#database-connectionprovider-datasource](https://docs.jboss.org/hibernate/stable/orm/userguide/html_single/Hibernate_User_Guide.html#database-connectionprovider-datasource) or even better, use an environment like a Java EE server(Wildfly, Payara) that comes with connection pooling configuration out of the box.

---

<div class="post-metadata">

**Author:** ![Aparna](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Aparna](https://discourse.hibernate.org/u/Aparna)\
**Post date:** [March 22, 2021, 7:10am UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695/3 "2021-03-22T07:10:21Z")

</div>

Am getting same excepiton.  
FAILURE! **17:26:42** org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] **17:26:42** at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.\_newInstance(SQLExceptionSapDB.java:191) **17:26:42** at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.newInstance(SQLExceptionSapDB.java:42) **17:26:42** at com.sap.db.jdbc.packet.HReplyPacket.\_buildExceptionChain(HReplyPacket.java:881) **17:26:42** at com.sap.db.jdbc.packet.HReplyPacket.getSQLExceptionChain(HReplyPacket.java:130) **17:26:42** at com.sap.db.jdbc.packet.HPartInfo.getSQLExceptionChain(HPartInfo.java:39) **17:26:42** at com.sap.db.jdbc.ConnectionSapDB.\_receive(ConnectionSapDB.java:2534) **17:26:42** at com.sap.db.jdbc.ConnectionSapDB.exchange(ConnectionSapDB.java:1507) **17:26:42** at com.sap.db.util.security.AuthenticationManager.authenticate(AuthenticationManager.java:115) **17:26:42** at com.sap.db.jdbc.ConnectionSapDB.\_getNewSession(ConnectionSapDB.java:2901) **17:26:42** at com.sap.db.jdbc.ConnectionSapDB.\_getNewConnection(ConnectionSapDB.java:2832) **17:26:42** at com.sap.db.jdbc.ConnectionSapDB.(ConnectionSapDB.java:194) **17:26:42** at com.sap.db.jdbc.ConnectionSapDBFinalize.(ConnectionSapDBFinalize.java:36) **17:26:42** at com.sap.db.jdbc.ConnectionSapDBFinalize.newInstance(ConnectionSapDBFinalize.java:23) **17:26:42** at com.sap.db.jdbc.Driver.\_connect(Driver.java:1441) **17:26:42** at com.sap.db.jdbc.Driver.connect(Driver.java:1068) **17:26:42** at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95) **17:26:42** at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101) **17:26:42** at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341) **17:26:42** at com.zaxxer.hikari.pool.HikariPool.checkFailFast(Hikari

Using RESTAssured to run API automation. Using hibernate to connect to HANA DB.  
Can you please help me to resolve this ?? Using DBeaver am able to connect to HANA DB instance,but same thing is failing from API automation…

---

<div class="post-metadata">

**Author:** ![sharif](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/sharif/32/2297_2.png) [@sharif](https://discourse.hibernate.org/u/sharif)\
**Post date:** [March 7, 2023, 12:57pm UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695/4 "2023-03-07T12:57:17Z")

</div>

Hello, Am facing the same issue with exact errors, what could be the solution?

Here is the pastebin [org.springframework.beans.factory.BeanCreationException: Error creating bean wit - Pastebin.com](https://pastebin.com/ruRev9Lj)

Looking forward for your support

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 8, 2023, 2:57pm UTC](https://discourse.hibernate.org/t/unable-to-create-requested-service-org-hibernate-engine-jdbc-env-spi-jdbcenvironment/4695/5 "2023-03-08T14:57:13Z")

</div>

There are so many environments where all of this works great and out of the box. If you want to build a custom environment and run into errors due to misconfiguration or bugs in your code, then you are on your own.  
The exceptions are all usually pretty clear. Hibernate is unable to acquire a connection through the connection provider, because the connection provider you are using has a problem (wrong credentials, network issue or whatever).
