Compiler error when using spring-boot:process-aot option to generate Native Code
Here is the ErrorStack
2025-05-28 15:59:22.046 [TID: N/A] [main] TRACE o.a.s.s.a.GlobalTransactionScanner -Creating implicit proxy for bean 'userApplication' with 0 common interceptors and 1 specific interceptors
Exception in thread "main" org.springframework.aop.framework.adapter.UnknownAdviceTypeException: Advice object [null] is neither a supported subinterface of [org.aopalliance.aop.Advice] nor an [org.springframework.aop.Advisor]
at org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.wrap(DefaultAdvisorAdapterRegistry.java:62)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.buildAdvisors(AbstractAutoProxyCreator.java:585)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.buildProxy(AbstractAutoProxyCreator.java:503)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxyClass(AbstractAutoProxyCreator.java:471)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.determineBeanType(AbstractAutoProxyCreator.java:251)
at org.springframework.context.support.GenericApplicationContext.preDetermineBeanType(GenericApplicationContext.java:471)
at org.springframework.context.support.GenericApplicationContext.preDetermineBeanTypes(GenericApplicationContext.java:450)
at org.springframework.context.support.GenericApplicationContext.refreshForAotProcessing(GenericApplicationContext.java:419)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:54)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:106)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:83)
at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:80)
the same issue others also encountered: https://github.com/spring-projects/spring-boot/issues/33700
Is there a proxy in userApplication? Starting from Seata 2.0, AOT compilation is not supported, and you need to manually use GraalVM's trace agent to collect metadata.
Is there a proxy in userApplication? Starting from Seata 2.0, AOT compilation is not supported, and you need to manually use GraalVM's trace agent to collect metadata.
the userApplication is the main app class ,i dont know why it need to be proxied. i have also start the app in jvm(not aot) and place the reflect-config.json,proxy-config.json etc. in resources/META-INF/native-images folders ,but mvn spring-boot:process-aot still report the same error
Is there a proxy in userApplication? Starting from Seata 2.0, AOT compilation is not supported, and you need to manually use GraalVM's trace agent to collect metadata.
@funky-eyes when i debugging the aot process , i found that the interceptor in GlobalTransactionalScanner is null,that caused the error ? how can i make the interceptor initialized before aot process?
@Override
protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource customTargetSource)
throws BeansException {
return new Object[]{interceptor}; // interceptor is null here !!!
}
如果在spring-boot:process-aot期间出现问题,建议在springboot-process-aot加上 -Dseata.enabled=false, 就不会出现以上问题
如果在spring-boot:process-aot期间出现问题,建议在springboot-process-aot加上 -Dseata.enabled=false, 就不会出现以上问题
thx, i'll try later