We're updating the issue view to help you get more done. 

NPE when using Hibernate 5.3 with second level cache during initializazion

Description

Hi there,

bootstrapping Hibernate 5.3 with Spring 5.0.4 with enabled second level cache causes a NPE:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 74 more Caused by: java.lang.NullPointerException at org.hibernate.cache.ehcache.internal.regions.EhcacheTransactionalDataRegion.<init>(EhcacheTransactionalDataRegion.java:58) at org.hibernate.cache.ehcache.internal.regions.EhcacheEntityRegion.<init>(EhcacheEntityRegion.java:47) at org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory.buildEntityRegion(AbstractEhcacheRegionFactory.java:108) at org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory.buildEntityRegion(SingletonEhCacheRegionFactory.java:31) at org.hibernate.cache.spi.RegionFactory.buildEntityRegion(RegionFactory.java:132) at org.hibernate.internal.CacheImpl.determineEntityRegionAccessStrategy(CacheImpl.java:451) at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:120) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:300) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:458) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726) at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:535) at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:519) at com.sobis.jaf.hibernate.boot.JAFLocalSessionFactoryBean.afterPropertiesSet(JAFLocalSessionFactoryBean.java:45) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) ... 93 more

The issue does not exists in 5.2.15. Please let me know which additional debugging details you need (model description, spring config).

Environment

None

Status

Assignee

Unassigned

Reporter

Niko Wittenbeck

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.15

Components

Affects versions

5.3.0.CR1

Priority

Major