Guest User

Untitled

a guest
Jan 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. da-report
  2. |src
  3. |main
  4. |java
  5. com.abc.da.app
  6. service/
  7. ComService
  8. AppConfig
  9. ComApp
  10. |resources
  11. build.gradle
  12.  
  13. 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.
  14.  
  15. Action:
  16.  
  17. Consider defining a bean of type 'com.abc.da.app.service.ComService' in your configuration.
  18.  
  19. ....
  20. @Service
  21. class ComService [
  22. }
  23.  
  24. ...
  25. object ComApp extends App {
  26. val cxt = new SpringApplicationBuilder().sources(classOf[ComApp])).run(args: _*)
  27. println("contain service class? " + cxt.getBean(""))
  28. }
  29.  
  30. @SpringBootApplication
  31. @Import(Array=(classOf[AppConfig]))
  32. @EnableAutoConfiguration()
  33. class ComApp {
  34. @Autowired var service: ComService = _
  35. }
  36.  
  37. ....
  38. @Configuration
  39. @ComponentScan(basePackages = Array("com.abc.da.app.service"))
  40. class AppConfig {
  41. }
Add Comment
Please, Sign In to add comment