Spring Boot“由于不是具体的顶级类而被忽略”

Dan*_*x43 5 java spring spring-data-jpa spring-boot

我有这个(https://github.com/Danix43/HerculesAPI)由Java和Spring Boot制作的REST应用程序。

当由于某种原因@SpringBootApplication注释不再找到TermometruService带有@Service.

我已经尝试了从使用@ComponentScan服务包开始的所有操作,但任何 Rest 操作都会返回RESOURCE_NOT_FOUND更改 jdk 版本和刷新 Maven 存储库。

项目结构(如果有用)

应用程序运行后的日志

2020-01-27 19:33:39.635 DEBUG 6248 --- [main] o.s.c.a.ClassPathBeanDefinitionScanner   : Ignored because not a concrete top-level class: file [D:\Programe\Programare\Java\HerculesAPI\target\classes\com\herculesapi\services\TermometruService.class]
Run Code Online (Sandbox Code Playgroud)

Dan*_*x43 1

通过使用 @Service 注解 TermometruServiceImple 类解决了该问题。另外,关于 Github 存储库,它并不总是立即推送所有更改,但 TermometruService 接口确实有注释。