Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression with @EnableJpaAuditing using Spring Boot 3.2-RC2 in native image #31575

Closed
Ricard-Kollcaku opened this issue Nov 8, 2023 · 3 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: regression A bug that is also a regression
Milestone

Comments

@Ricard-Kollcaku
Copy link

Ricard-Kollcaku commented Nov 8, 2023

We have a working application running on spring boot 3.1.5 using java 21 as a native image and everything works ok
we are trying to upgrade that application to 3.2.0-RC2 to get the benefit of project loom and get prepared for GA release but we see some issue

When we migrate to spring boot 3.2.0-RC2 and upgrade the native build tool to 0.9.28 we get the following error
After some researches the error happens only when we use the annotation @EnableJpaAuditing

Please check more in the conversation in previews open issue
from: #spring-projects/spring-data-jpa#3222

Simple Project here

StackTrace:

Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'identifier' at character position 0

        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(PointcutParser.java:334) ~[demo:na]
        at org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePointcutExpression(InternalUseOnlyPointcutParser.java:36) ~[na:na]
        at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307) ~[na:na]
        at org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.java:890) ~[demo:1.9.20]
        at org.aspectj.weaver.ResolvedType$PointcutGetter.get(ResolvedType.java:261) ~[na:na]
        at org.aspectj.weaver.ResolvedType$PointcutGetter.get(ResolvedType.java:258) ~[na:na]
        at org.aspectj.weaver.Iterators$4$1.hasNext(Iterators.java:213) ~[na:na]
        at org.aspectj.weaver.Iterators$6.hasNext(Iterators.java:288) ~[na:na]
        at org.aspectj.weaver.Iterators$4.hasNext(Iterators.java:230) ~[na:na]
        at org.aspectj.weaver.ResolvedType.findPointcut(ResolvedType.java:767) ~[demo:1.9.20]
        at org.aspectj.weaver.patterns.ReferencePointcut.resolveBindings(ReferencePointcut.java:148) ~[na:na]
        at org.aspectj.weaver.patterns.Pointcut.resolve(Pointcut.java:189) ~[demo:na]
        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(PointcutParser.java:331) ~[demo:na]
        at org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePointcutExpression(InternalUseOnlyPointcutParser.java:36) ~[na:na]
        at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307) ~[na:na]
        at org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.java:890) ~[demo:1.9.20]
        at org.aspectj.weaver.ResolvedType$PointcutGetter.get(ResolvedType.java:261) ~[na:na]
        at org.aspectj.weaver.ResolvedType$PointcutGetter.get(ResolvedType.java:258) ~[na:na]
        at org.aspectj.weaver.Iterators$4$1.hasNext(Iterators.java:213) ~[na:na]
        at org.aspectj.weaver.Iterators$4.hasNext(Iterators.java:230) ~[na:na]
        at org.aspectj.weaver.ResolvedType.findPointcut(ResolvedType.java:767) ~[demo:1.9.20]
        at org.aspectj.weaver.patterns.ReferencePointcut.resolveBindings(ReferencePointcut.java:148) ~[na:na]
        at org.aspectj.weaver.patterns.AndPointcut.resolveBindings(AndPointcut.java:83) ~[na:na]
        at org.aspectj.weaver.patterns.Pointcut.resolve(Pointcut.java:189) ~[demo:na]
        at org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(PointcutParser.java:331) ~[demo:na]
        at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:312) ~[demo:na]
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:222) ~[na:na]
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.obtainPointcutExpression(AspectJExpressionPointcut.java:193) ~[na:na]
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:172) ~[na:na]
        at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:234) ~[na:na]
        at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:296) ~[na:na]
        at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:328) ~[na:na]
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:128) ~[demo:6.1.0-RC2]
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:97) ~[demo:6.1.0-RC2]
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:78) ~[demo:6.1.0-RC2]
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:366) ~[demo:6.1.0-RC2]
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:318) ~[demo:6.1.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:437) ~[demo:6.1.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[demo:6.1.0-RC2]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[demo:6.1.0-RC2]
        ... 69 common frames omitted
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 8, 2023
@sdeleuze sdeleuze self-assigned this Nov 9, 2023
@sdeleuze sdeleuze added in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 9, 2023
@sdeleuze sdeleuze added this to the 6.1.0 milestone Nov 9, 2023
@sbrannen sbrannen changed the title Spring boot 3.2-RC2 @EnableJpaAuditing problems in native image Regression with @EnableJpaAuditing using Spring Boot 3.2-RC2 in native image Nov 9, 2023
@sdeleuze
Copy link
Contributor

The missing reflection entry is:

[
{
  "name":"org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect",
  "allDeclaredFields":true
}
]

@Ricard-Kollcaku
Copy link
Author

Thanks that works, should we add it manually or it will be included in spring framework 6.1 release ?

@sdeleuze
Copy link
Contributor

The fix should be included in the specified milestone, which is at this time 6.1.0 (but could be updated).

bclozel added a commit that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants