`@PreAuthorize` 与 spring-native 触发打包错误:`repeated interface: org.springframework.aop.SpringProxy`

问题描述

我正在尝试在 maven multi-module project 中为 spring-boot 应用程序构建本机映像。

一旦我用 @PreAuthorize 修饰 @Controller 方法,本机图像生成就会失败并显示以下消息。

遵循 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

知道为什么吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)