建包以后 啟動失敗 提示找不到類
我本地JDK是1.7版本 但是spring使用的是4版本 之前在一個包下沒有什么問題,但是分開以后啟動mvn intall的時候就報錯(最后附錯誤信息),是不是spring4依賴的jdk1.8以上的版本 ?但是在沒有分開包的時候是沒有問題的 ,分開之后一直提示找不到類 但是實際是有的;
***************************
APPLICATION FAILED TO START
***************************
Description:
Field grilRespository in com.example.demo.CrilController2 required a bean of type 'com.example.respository.GrilRespository' that could not be found.
Action:
Consider defining a bean of type 'com.example.respository.GrilRespository' in your configuration.
2017-10-25 12:16:41.085 ERROR 56864 --- [?????????? main] o.s.test.context.TestContextManager????? : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@28f270bc] to prepare test instance [com.example.demo.MySpringBootApplicationTests@5cf81994]
2017-10-25
應該是沒有給你的GirlRepository使用@repository注解,導致注入失敗。