-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Description
I have an example application which uses Spring Boot 4, Spring JPA with Hibernate, PostgreSQL database. The goal is to produce a GraalVM Native Image deploy it on AWS Lambda as Custom Runtime. The issue should be reproducable by simply running the native image without AWS Lambda.
During start up of AWS Lambda, I got the following exception:
Caused by: java.lang.UnsupportedOperationException: CGLIB runtime enhancement not supported on native image. Make sure to enable Spring AOT processing to pre-generate 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean$$SpringCGLIB$$0' at build time.
It's coming from definition of the PlatformTransactionManager in the PersistenceJPAConfig.java used to create LocalContainerEntityManagerFactoryBean.
I expect that this class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean$$SpringCGLIB$$0 should be generated at the compile time as I use Spring AOT processor in pom.xml.
What I'm doing wrong?
The only way I found to currently mitigate the issue, is to use @Configuration(proxyBeanMethods = false) in the PersistenceJPAConfig, but I have an impression that I'm loosing performance by not proxying the bean methods.