尝试运行 spring boot 应用程序时出现以下错误

时间:2021-06-18 07:35:53

标签: spring-boot spring-mvc

<块引用>

启动 ApplicationContext 时出错。显示条件报告 在启用“调试”的情况下重新运行您的应用程序。 2021-06-18 12:42:19.152 错误 21120 --- [restartedMain] o.s.boot.SpringApplication
: 应用程序运行失败

org.springframework.beans.factory.BeanCreationException:错误 使用在类路径资源中定义的名称“viewResolver”创建 bean [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]: bean 初始化失败;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException: 使用类中定义的名称“thymeleafViewResolver”创建 bean 时出错 路径资源 [org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration$ThymeleafWebMvcConfiguration$ThymeleafViewResolverConfiguration.class]: 通过方法表达的不满足的依赖 'thymeleafViewResolver'参数1;嵌套异常是 org.springframework.beans.factory.BeanCreationException:错误 创建名为 'templateEngine' 的 bean 在类路径中定义 资源 [org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.class]: 通过工厂方法的 Bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException: 失败 实例化 [org.thymeleaf.spring5.SpringTemplateEngine]:工厂 方法“templateEngine”抛出异常;嵌套异常是 org.springframework.beans.factory.BeanCreationException:错误 使用在类路径中定义的名称“securityDialect”创建 bean 资源 [org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration$ThymeleafSecurityDialectConfiguration.class]: 合并bean定义后处理失败;嵌套异常是 java.lang.IllegalStateException:无法内省类 [org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect] 来自 ClassLoader [sun.misc.Launcher$AppClassLoader@764c12b6] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE] 在 org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE] 在 com.example.demo.RegistrationandloginApplication.main(RegistrationandloginApplication.java:10) [classes/:na] 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native 方法)~[na:1.8.0_232] 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_232] 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_232] 在 java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_232] 在 org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.3.0.RELEASE.jar:2.3.0.RELEASE]

0 个答案:

没有答案