brettwooldridge / HikariCP

光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Apache License 2.0
19.91k stars 2.92k forks source link

[Bug] Issue with Springboot and Hibernate. #2136

Closed DxsSucuk closed 10 months ago

DxsSucuk commented 11 months ago

For the past weeks Springboot can no longer seem to find the right JDNI name of Hikari? Error message:

org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Error parsing JNDI name [com.zaxxer.hikari.HikariDataSource]

Springboot config:

server.port=8888
logging.file.name=logs/logs.log
spring.banner.location=banner/banner.txt
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
sentry.dsn=https://2b1724cca5524af180760943bcd4ad14@o4503927742529536.ingest.sentry.io/4504082739822592

Pom (from the dependency which provides all the stuff)

<dependency>
   <groupId>org.hibernate.orm</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>6.2.9.Final</version>
</dependency>
<dependency>
   <groupId>org.hibernate.orm</groupId>
   <artifactId>hibernate-community-dialects</artifactId>
   <version>6.2.9.Final</version>
</dependency>
<dependency>
   <groupId>com.zaxxer</groupId>
   <artifactId>HikariCP</artifactId>
   <version>5.0.1</version>
 </dependency>
<dependency>
   <groupId>org.hibernate.orm</groupId>
   <artifactId>hibernate-hikaricp</artifactId>
   <version>6.2.9.Final</version>
</dependency>

Is there anything I missed that might cause this issue or?

lfbayer commented 10 months ago

I doubt this is a HikariCP issue. Was it working without any problem before "the past weeks", and if so, what changed in that time?

DxsSucuk commented 10 months ago

It did, it seems like by either upgrading Hibernate or or Hikari they no longer like to work with Springboot? When I first encountered this Issue, I was able to fix it by reverting to a older Hibernate version. But now after updating Hikari its not a big fan.

DxsSucuk commented 10 months ago

Closing this Issue, since after even more testing it seems like this has nothing to do with Springboot and Hikari in itself. But rather Hibernate or something misconfigurated on my end.

If anyone seems to have the same Issue I opened a discussion on the Hibernate Forum. https://discourse.hibernate.org/t/hibernate6-with-hikaricp-on-springboot-fails-to-boot/8614/7

As a workaround downgrading to Hibernate 6.2.9 seems to work.