最后看编辑......
我将应用程序的依赖关系从1.5.3-RELEASE更新为1.5.9-RELEASE
***************************
APPLICATION FAILED TO START
***************************
Description:
Field mrepo in com.test.svc.TestHandler required a bean of type 'com.test.data.MongoTestRepository' that could not be found.
Action:
Consider defining a bean of type 'com.test.MongoTestRepository' in your configuration.
我的Application.java位于com.test.Application并且有通常的东西:
@ServletComponentScan
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
我的TestHandler是@Service
@Service
public class TestHandler {
@Autowired
private MongoTestRepository mrepo;
...
}
我的MongoTestRepository是一个在MongoTest类上运行的@Repository接口
@Repository
public interface MongoTestRepository extends MongoRepository<MongoTest, String> {
}
所以,使用旧版本的spring-boot软件包(1.5.3-RELEASE)一切正常。更新到1.5.9-RELEASE并构建但在部署/启动时给出了上述错误。
这里发生了什么?是否有一些我缺少的新注释?为什么次要版本更新突然破坏了这个?
编辑=我错了,这是对spring-data-mongodb软件包的更新。它同时从1.10.9-RELEASE更新到2.0.2-RELEASE,我没有立即注意到。