Skip to content

Reflection hints missing for SpringPersistenceUnitInfo.setPersistenceProviderPackageName #35655

@mhalbritter

Description

@mhalbritter

All these failed AOT smoke tests in native-image have the same cause:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': null
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1818)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:604)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:526)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:371)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:966)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:620)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:765)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:454)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1374)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
	at com.example.spring.orm.HibernateEnhancedApplication.main(HibernateEnhancedApplication.java:28)
	at java.base@25/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.lang.reflect.UndeclaredThrowableException
	at jdk.proxy4/jdk.proxy4.$Proxy/sbcd875d8.setPersistenceProviderPackageName(Unknown Source)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1865)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1814)
	... 15 more
Caused by: java.lang.NoSuchMethodException: org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.setPersistenceProviderPackageName(java.lang.String)
	at java.base@25/java.lang.Class.checkMethod(DynamicHub.java:1343)
	at java.base@25/java.lang.Class.getMethod(DynamicHub.java:1337)
	at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo$SmartPersistenceUnitInfoInvocationHandler.invoke(SpringPersistenceUnitInfo.java:165)
	... 19 more

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)theme: aotAn issue related to Ahead-of-time processingtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions