The following method did not exist: org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional;
时间: 2023-12-03 13:46:11 浏览: 177
这个错误通常是由于缺少Spring Plugin Core库引起的。你需要将以下依赖项添加到你的pom.xml文件中:
```
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
```
如果你使用的是Gradle,你可以在build.gradle文件中添加以下代码:
```
dependencies {
implementation 'org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE'
}
```
添加这个依赖后,重新运行你的应用程序应该就不会再出现这个错误了。
相关问题
Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.lambda$customizeRejectIllegalHeader$24(TomcatWebServerFactoryCustomizer.java:209) The following method did not exist: org.apache.coyote.http11.AbstractHttp11Protocol.setRejectIllegalHeader(Z)V
这个错误的意思是尝试调用一个不存在的方法。看起来是在Spring Boot应用程序中使用了一个TomcatWebServerFactoryCustomizer中的方法,但是该方法依赖于一个不存在的方法org.apache.coyote.http11.AbstractHttp11Protocol.setRejectIllegalHeader(Z)V。这可能是由于版本不匹配或依赖关系问题引起的。您可以尝试更新相关依赖项,以确保它们与您的Spring Boot版本兼容。
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2023-05-15T22:28:42.434+08:00 ERROR 9660 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.boot.autoconfigure.security.servlet.SpringBootWebSecurityConfiguration$SecurityFilterChainConfiguration.defaultSecurityFilterChain(SpringBootWebSecurityConfiguration.java:56) The following method did not exist: 'org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer$AuthorizationManagerRequestMatcherRegistry org.springframework.security.config.annotation.web.builders.HttpSecurity.authorizeHttpRequests()' The calling method's class, org.springframework.boot.autoconfigure.security.servlet.SpringBootWebSecurityConfiguration$SecurityFilterChainConfiguration, was loaded from the following location: jar:file:/C:/Users/86152/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.0.6/spring-boot-autoconfigure-3.0.6.jar!/org/springframework/boot/autoconfigure/security/servlet/SpringBootWebSecurityConfiguration$SecurityFilterChainConfiguration.class The called method's class, org.springframework.security.config.annotation.web.builders.HttpSecurity, is available from the following locations: jar:file:/C:/Users/86152/.m2/repository/org/springframework/security/spring-security-config/5.5.0/spring-security-config-5.5.0.jar!/org/springframework/security/config/annotation/web/builders/HttpSecurity.class The called method's class hierarchy was loaded from the following locations: org.springframework.security.config.annotation.web.builders.HttpSecurity: file:/C:/Users/86152/.m2/repository/org/springframework/security/spring-security-config/5.5.0/spring-security-config-5.5.0.jar org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder: file:/C:/Users/86152/.m2/repository/org/springframework/security/spring-security-config/5.5.0/spring-security-config-5.5.0.jar org.springframework.security.config.annotation.AbstractSecurityBuilder: file:/C:/Users/86152/.m2/repository/org/springframework/security/spring-security-config/5.5.0/spring-security-config-5.5.0.jar
这个错误信息看起来是 Spring Boot 应用启动失败了,可能是因为在 Spring Security 的配置中调用了一个不存在的方法导致的。建议你重新运行应用并开启调试模式,查看详细的错误信息。同时,你也可以检查一下应用中的 Spring Security 配置,确认是否存在调用了不存在的方法的情况。
阅读全文