Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- da-report
- |src
- |main
- |java
- com.abc.da.app
- service/
- ComService
- AppConfig
- ComApp
- |resources
- build.gradle
- Field service in com.abc.da.app.service.ComApp required a bean of type 'com.abc.da.app.service.ComService' that could not be found.
- Action:
- Consider defining a bean of type 'com.abc.da.app.service.ComService' in your configuration.
- ....
- @Service
- class ComService [
- }
- ...
- object ComApp extends App {
- val cxt = new SpringApplicationBuilder().sources(classOf[ComApp])).run(args: _*)
- println("contain service class? " + cxt.getBean(""))
- }
- @SpringBootApplication
- @Import(Array=(classOf[AppConfig]))
- @EnableAutoConfiguration()
- class ComApp {
- @Autowired var service: ComService = _
- }
- ....
- @Configuration
- @ComponentScan(basePackages = Array("com.abc.da.app.service"))
- class AppConfig {
- }
Add Comment
Please, Sign In to add comment