org.springframework.aot.context.bootstrap.generator.generator.beandefinitiongenerationException:无法处理带有名称' xxx的bean并键入XXX&#xxx'
我想尝试春季。我有一个自定义的bean,但是当我运行“ spring-aot:生成”或“ spring-boot:build-image”时,我会得到以下例外。我不知道如何配置和添加提示密钥异常信息如
org.springframework.aot.context.bootstrap.generator.BeanDefinitionGenerationException: Failed to handle bean with name 'devInfoHeaderFilter' and type 'tablo.jhin.application.filters.DevInfoHeaderFilter' at org.springframework.aot.context.bootstrap.generator.ApplicationContextAotProcessor.writeBeanDefinitions
...
Caused by: java.lang.IllegalStateException: Multiple privileged packages: [tablo.jhin.config, tablo.jhin.application.filters]at org.springframework.aot.context.bootstrap.generator.infrastructure.ProtectedAccessAnalysis.getPrivilegedPackageName
...
[ERROR]
org.apache.maven.plugin.MojoExecutionException: Could not exec java
at org.springframework.aot.maven.AbstractBootstrapMojo.forkJvm (AbstractBootstrapMojo.java:197)
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Bootstrap code generator finished with exit code: 1
at org.springframework.aot.maven.AbstractBootstrapMojo.forkJvm (AbstractBootstrapMojo.java:190)
at org.springframework.aot.maven.GenerateMojo.execute (GenerateMojo.java:132)
....
“ tableo.jhin.config”下的内部类中如下所示,我配置了这样的bean:servicetracefilterconfiguration作为内部类
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
static class ServletTraceFilterConfiguration implements NativeConfiguration {
@Bean
public DevInfoHeaderFilter devInfoHeaderFilter() {
return new DevInfoHeaderFilter();
}
}
I want to try SpringNative. I have a custom Bean, but when I run "spring-aot:generate" or "spring-boot:build-image", I get the following exception. I don't know how to configure and add Hint Key exception information is as follows
org.springframework.aot.context.bootstrap.generator.BeanDefinitionGenerationException: Failed to handle bean with name 'devInfoHeaderFilter' and type 'tablo.jhin.application.filters.DevInfoHeaderFilter' at org.springframework.aot.context.bootstrap.generator.ApplicationContextAotProcessor.writeBeanDefinitions
...
Caused by: java.lang.IllegalStateException: Multiple privileged packages: [tablo.jhin.config, tablo.jhin.application.filters]at org.springframework.aot.context.bootstrap.generator.infrastructure.ProtectedAccessAnalysis.getPrivilegedPackageName
...
[ERROR]
org.apache.maven.plugin.MojoExecutionException: Could not exec java
at org.springframework.aot.maven.AbstractBootstrapMojo.forkJvm (AbstractBootstrapMojo.java:197)
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Bootstrap code generator finished with exit code: 1
at org.springframework.aot.maven.AbstractBootstrapMojo.forkJvm (AbstractBootstrapMojo.java:190)
at org.springframework.aot.maven.GenerateMojo.execute (GenerateMojo.java:132)
....
In a internal class under the 'tablo.jhin.config', I configured such a Bean: ServiceTraceFilterConfiguration as an internal class
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
static class ServletTraceFilterConfiguration implements NativeConfiguration {
@Bean
public DevInfoHeaderFilter devInfoHeaderFilter() {
return new DevInfoHeaderFilter();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论