我正在尝试在 Maven多模块项目中为 spring-boot 应用程序构建本机映像。
一旦我用 装饰 @Controller 方法@PreAuthorize
,本机图像生成就会失败,并显示以下消息。
在 spring-native 示例之后,我在应用程序类上尝试了使用(如在 中完成security-method-class-proxies
)和不使用(如在 中完成security-method
)@AotProxyHint
,但这没有任何区别。
错误:
[INFO] [creator] Error: Error parsing dynamic proxy configuration in file:/workspace/META-INF/native-image/org.springframework.aot/spring-aot/proxy-config.json:
[INFO] [creator] java.lang.IllegalArgumentException: repeated interface: org.springframework.aop.SpringProxy
[INFO] [creator] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option DynamicProxyConfigurationResources.
[INFO] [creator] Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
[INFO] [creator] Error: Image build request failed with exit status 1
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to contribute native-image layer
[INFO] [creator] error running build
[INFO] [creator] exit status 1
[INFO] [creator] ERROR: failed to build: exit status 1
任何线索为什么?