Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] after Java 13 migration

Viewed 67

I was working on a Spring boot research project which connects to a mariadb database using Hibernate, in Java 1.8. Recently I have upgrated to Java version to 13. Now following error occures when my application try to use database connection.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.sqlDBServiceHibernateImpl' defined in file [F:\RND\negorate-inventory\negorate-data-service\target\classes\it\codegen\rnd\negorate\dataservice\services\SqlDBServiceHibernateImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [it.codegen.rnd.negorate.dataservice.services.SqlDBServiceHibernateImpl]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.hibernateConnectorProvider' defined in file [F:\RND\negorate-inventory\negorate-data-service\target\classes\it\codegen\rnd\negorate\dataservice\connectors\HibernateConnectorProvider.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [it.codegen.rnd.negorate.dataservice.connectors.HibernateConnectorProvider]: Constructor threw exception; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:312)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:293)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:359)
at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:390)
at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:184)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:356)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at it.codegen.rnd.negorate.dataservice.services.SqlDBServiceHibernateImpl$$EnhancerBySpringCGLIB$$a8a80337.getSessionTokenByKey(<generated>)

Hibernate configurations in application.properties file.

hibernate.connection-url=jdbc:mariadb://192.168.2.144:3306/negorate_qa
hibernate.driver-class=org.mariadb.jdbc.Driver
hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
hibernate.hbm2ddl-auto=validate

Maven dependencies in pom.xml file.

<dependency>
    <groupId>it.codegen.rnd</groupId>
    <artifactId>hibernate-connector</artifactId>
    <version>5.2.1.16</version>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-c3p0</artifactId>
    <version>5.4.5.Final</version>
</dependency>
<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <version>2.7.2</version>
</dependency>

hibernate-connector is a company specific dependency which is based on hibernate-core 5.4.5.Final version.

Database specification,

mysql> status;
--------------
mysql  Ver 8.0.20 for Win64 on x86_64 (MySQL Community Server - GPL)

Connection id:          1930851
Current database:       negorate_qa
Current user:           admin@172.16.4.60
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.5.5-10.3.9-MariaDB-1:10.3.9+maria~trusty-log mariadb.org binary distribution
Protocol version:       10
Connection:             192.168.2.144 via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    cp850
Conn.  characterset:    cp850
TCP port:               3306
Binary data as:         Hexadecimal
Uptime:                 63 days 21 hours 26 min 27 sec

I need to know what exactly happned after the Java migration and how to fix this issues. Thank you. ( I tried severel similar questions, but none of them solved this scenario. )

0 Answers
Related