Hi, I’m attempting to migrate existing program from hibernate 5 to 6.0.0.Alpha9. Aware that spring/hibernate6 may not be compatible yet but giving it a try. I’m encountering some exception when trying to startup the application.
Exception
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource
[com/demo/test/sample/monolith/generated/config/DataBaseConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NullPoi
nterException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:307)
at com.demo.test.sample.monolith.generated.config.DataBaseConfiguration$$EnhancerBySpringCGLIB$$be3098c6.entityManagerFactory()
at com.demo.test.sample.monolith.generated.config.DataBaseConfiguration.transactionManager(DataBaseConfiguration.java:67)
at com.demo.test.sample.monolith.generated.config.DataBaseConfiguration$$EnhancerBySpringCGLIB$$be3098c6.CGLIB$transactionManager$0()
at com.demo.test.sample.monolith.generated.config.DataBaseConfiguration$$EnhancerBySpringCGLIB$$be3098c6$$FastClassBySpringCGLIB$$438e057.inv
oke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.demo.test.sample.monolith.generated.config.DataBaseConfiguration$$EnhancerBySpringCGLIB$$be3098c6.transactionManager()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
… 149 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.hibernate.type.internal.UserTypeJavaTypeWrapper.(UserTypeJavaTypeWrapper.java:49)
at org.hibernate.type.CustomType.(CustomType.java:89)
at org.hibernate.type.CustomType.(CustomType.java:73)
at org.hibernate.boot.model.TypeDefinition.createResolution(TypeDefinition.java:180)
at org.hibernate.boot.model.TypeDefinition.createResolution(TypeDefinition.java:120)
at org.hibernate.boot.model.TypeDefinition.resolve(TypeDefinition.java:104)
at org.hibernate.mapping.BasicValue.interpretExplicitlyNamedType(BasicValue.java:524)
at org.hibernate.mapping.BasicValue.buildResolution(BasicValue.java:281)
at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:249)
at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:239)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.lambda$processValueResolvers$4(InFlightMetadataCollectorImpl.java:1729)
at java.util.ArrayList.removeIf(ArrayList.java:1415)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processValueResolvers(InFlightMetadataCollectorImpl.java:1728)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1714)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.buildMetadataInstance(InFlightMetadataCollectorImpl.java:2298)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:325)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1345)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1416)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistencePro
vider.java:58)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.ja
va:365)
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:341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
… 168 common frames omitted
It seems to be hitting a nullpointer at “org.hibernate.type.internal.UserTypeJavaTypeWrapper.”.