Hi
I have recently changed the “Hibernate Core” dependency version from 5.4.18.FINAL to 5.4.24.FINAL.But i am getting " error creating bean with the name entityManagerFactory" error.Can someone help resolve this issue?
-Regards
Hi
I have recently changed the “Hibernate Core” dependency version from 5.4.18.FINAL to 5.4.24.FINAL.But i am getting " error creating bean with the name entityManagerFactory" error.Can someone help resolve this issue?
-Regards
Sorry, but this is as uninformative as it can be. Would you mind sharing more details with us, like for example the whole error log?
2021-02-09 08:58:18.782-0500 org INFO test No active profile set, falling back to default profiles: default
2021-02-09 08:58:20.280-0500 org INFO o.s.d.r.c.RepositoryConfigurationDelegate Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-09 08:58:20.417-0500 org INFO o.s.d.r.c.RepositoryConfigurationDelegate Finished Spring Data repository scanning in 125ms. Found 13 JPA repository interfaces.
2021-02-09 08:58:21.147-0500 org WARN o.s.boot.actuate.endpoint.EndpointId Endpoint ID ‘service-registry’ contains invalid characters, please migrate to a valid format.
2021-02-09 08:58:21.329-0500 org INFO o.s.cloud.context.scope.GenericScope BeanFactory id=4f3cb504-0d83-30d5-a7a6-3448cfd24af0
2021-02-09 08:58:21.676-0500 org INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean ‘org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@53a50b0a’ of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-02-09 08:58:21.684-0500 test1 test1
test test INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean ‘test1.filter.FilterMappingAutoConfiguration’ of type [test1.autoconfig.filter.FilterMappingAutoConfiguration$$EnhancerBySpringCGLIB$$2d8679e1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-02-09 08:58:22.043-0500 test1 INFO o.s.b.w.embedded.tomcat.TomcatWebServer Tomcat initialized with port(s): 8082 (http)
2021-02-09 08:58:22.054-0500 test1 INFO o.apache.catalina.core.StandardService Starting service [Tomcat]
2021-02-09 08:58:22.054-0500 test1 INFO org.apache.catalina.core.StandardEngine Starting Servlet engine: [Apache Tomcat/9.0.40]
2021-02-09 08:58:22.239-0500 test1 INFO o.a.c.c.C.[Tomcat].[localhost].[/] Initializing Spring embedded WebApplicationContext
2021-02-09 08:58:22.239-0500 test1 test INFO o.s.web.context.ContextLoader Root WebApplicationContext: initialization completed in 3438 ms
2021-02-09 08:58:22.264-0500 test1 test INFO c.j.m.b.a.l.LoggingAutoConfiguration$WebApplicationLoggingAutoConfiguration Enabled Moneta Spring MVC Perf Logging
2021-02-09 08:58:22.269-0500 test1 test INFO c.j.m.b.a.l.LoggingAutoConfiguration$WebApplicationLoggingAutoConfiguration Enabled Moneta Request Logging with exclude-url-patterns: [], http.log-request-headers: [false], http.log-response-headers: [false], http.log-request-entity: [false], http.log-response-entity: [false] and http.max-entity-bytes: [1024]
2021-02-09 08:58:22.281-0500 test1 test INFO c.j.m.b.a.s.cors.CorsAutoConfiguration Moneta CORS has been disabled because neither [moneta.cors.allowed-origins] nor [moneta.cors.allowed-origins-regex] has been set
2021-02-09 08:58:22.406-0500 test1 test WARN c.n.c.sources.URLConfigurationSource No URLs will be polled as dynamic configuration sources.
2021-02-09 08:58:22.407-0500 test1 test INFO c.n.c.sources.URLConfigurationSource To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2021-02-09 08:58:22.421-0500 test1 test INFO c.netflix.config.DynamicPropertyFactory DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@10131289
2021-02-09 08:58:22.497-0500 test1 test INFO c.j.m.b.a.a.MonetaActuatorAutoConfiguration Initalized defaults for Moneta Boot Actuator
2021-02-09 08:58:22.791-0500 test1 test INFO o.s.boot.web.servlet.RegistrationBean Filter corsFilter was not registered (disabled)
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2021-02-09 08:58:23.004-0500 test1 test INFO o.hibernate.jpa.internal.util.LogHelper HHH000204: Processing PersistenceUnitInfo [name: default]
2021-02-09 08:58:23.106-0500 test1 test INFO org.hibernate.Version HHH000412: Hibernate ORM core version 5.4.24.Final
2021-02-09 08:58:23.106-0500 test1 test INFO org.hibernate.cfg.Environment HHH000205: Loaded properties from resource hibernate.properties: {org.hibernate.envers.audit_table_suffix=_HIST, org.hibernate.envers.revision_field_name=RVS_HIST_ID, hibernate.bytecode.use_reflection_optimizer=false, org.hibernate.envers.revision_type_field_name=RVS_TYPE_CD}
2021-02-09 08:58:23.276-0500 test1 test INFO o.hibernate.annotations.common.Version HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-02-09 08:58:23.496-0500 test1 test INFO com.zaxxer.hikari.HikariDataSource HikariPool-1 - Starting…
2021-02-09 08:58:23.497-0500 test1 test WARN com.zaxxer.hikari.util.DriverDataSource Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2021-02-09 08:58:23.913-0500 test1 test INFO com.zaxxer.hikari.HikariDataSource HikariPool-1 - Start completed.
2021-02-09 08:58:23.933-0500 test1 test INFO org.hibernate.dialect.Dialect HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2021-02-09 08:58:24.019-0500 test1 test WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource [test1.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/internal/util/xml/XMLHelper
2021-02-09 08:58:24.020-0500 test1 test INFO com.zaxxer.hikari.HikariDataSource HikariPool-1 - Shutdown initiated…
2021-02-09 08:58:24.033-0500 test1 test INFO com.zaxxer.hikari.HikariDataSource HikariPool-1 - Shutdown completed.
2021-02-09 08:58:24.035-0500 test1 test INFO o.apache.catalina.core.StandardService Stopping service [Tomcat]
2021-02-09 08:58:24.053-0500 test1 test INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-02-09 08:58:24.073-0500 test1 test ERROR o.s.boot.SpringApplication Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource [test1]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/internal/util/xml/XMLHelper
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at test1
Caused by: java.lang.NoClassDefFoundError: org/hibernate/internal/util/xml/XMLHelper
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.applyInjections(AbstractServiceRegistryImpl.java:292)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:283)
Seems like you have an old version of hibernate-envers on the classpath. This class was moved as part of [HHH-14096] Removal of unused code: XMLHelper and its SAXReader factory helper - Hibernate JIRA
may i know the new version?
what is the fix for this?
It’s the same version as Hibernate Core. I don’t know how you setup you application.
initially all the dependencies are in 5.4.18.final version.i am getting this error after updating to 5.4.24.final.when i add below code to the spring boot application i am able to run without issues. But its not getting the data.
replaced @springbootapplication to below code:
@enableautoconfiguration( exclude =DataautoConfiguration.class})
Thanks for your help.I had to remove the older versions to make it work.