I am recently upgrading my project to Hibernate 6 with spring boot 3, I get below error
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'test.dl.nonxa.entityManagerFactory' defined in class path resource [test-dl-nonxa-entity-manager.xml]: jakarta/transaction/SystemException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1806)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:954)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:174)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:154)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:96)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4414)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
... 43 more
Caused by: java.lang.NoClassDefFoundError: jakarta/transaction/SystemException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2571)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2532)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2518)
at org.hibernate.internal.HEMLogging.messageLogger(HEMLogging.java:28)
at org.hibernate.internal.HEMLogging.messageLogger(HEMLogging.java:24)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<clinit>(EntityManagerFactoryBuilderImpl.java:142)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:63)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1802)
... 61 more
Caused by: java.lang.ClassNotFoundException: jakarta.transaction.SystemException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1144)
Here are the bean definations for the same
<bean id="test.dl.nonxa.entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="test.dl.nonxa.dataSource" p:persistenceXmlLocation="classpath:test-dl-persistence-unit.xml"
p:persistenceUnitName="${jpa.persistence.unit.name:fsp}"
p:packagesToScan-ref="collaboration.dl.nonxa.entityManagerFactory.packagesToScan">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="jpaProperties">
<props>
---------------
---------------
---------------
</props>
</property>
</bean>
<bean id="test.dl.nonxa.dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
destroy-method="close" p:driverClassName="${test.global.database.jdbc.dataSource.driver}"
p:url=
p:username=
p:validationQuery=
p:poolPreparedStatements="true"
p:removeAbandonedOnMaintenance=
p:removeAbandonedOnBorrow=
p:removeAbandonedTimeout=
p:logAbandoned=
p:maxOpenPreparedStatements=
p:accessToUnderlyingConnectionAllowed=
p:initialSize=
p:maxTotal=
p:maxIdle=
p:testOnBorrow=
p:testOnReturn=
p:testWhileIdle=
p:connectionProperties=
p:timeBetweenEvictionRunsMillis=
p:minEvictableIdleTimeMillis=
p:softMinEvictableIdleTimeMillis=
p:maxConnLifetimeMillis=
p:autoCommitOnReturn=
p:defaultAutoCommit=