Spring Boot Sping Boot :无法解析配置类

uinbv5nw  于 2023-06-05  发布在  Spring
关注(0)|答案(1)|浏览(228)

我是新的Spring Boot 技术。我已经创建了一个非常基本的应用程序。这个想法是使用Sping Boot 发布HTML页面。我使用的工具是STS 4(版本4.18)。我在src/main/resources中创建了一个html文件,包括静态和模板。然后我创建了一个普通类LoadRegistrationPage(用@Component,@Controller @PropertySource注解)
LoadRegistrationPage
然后,我创建了一个ConfigClass,并使用@Configuration @ComponentScan @PropertySource进行注解。
ConfigClass
最后我从主类UserRegistrationPageApplication调用了它
UserRegistrationPageApplication
现在当我以SpringBootApplication的身份运行时,它会出现异常“Failed to parse configuration class [application.com.example.UserRegistrationPage.UserRegistrationPageApplication]"。
Exception
我尝试了很多方法,但无法理解这里的问题是什么。请大家在此提出建议。
问候,维沙尔
我绑在下面说
1.在config类中引入了@component scan。

ykejflvf

ykejflvf1#

@PropertySource似乎不正确。
尝试
@PropertySource(value = "classpath:templates/Registrationcode.html")
反而

相关问题