添加service层服务后, 通过controller调用service层报如下错误

Servlet.init() for servlet springMVC threw exception


检查代码serviceimpl中 有添加注解配置的啊

Servlet.init() for servlet springMVC threw exception


然后查看spring-mvc.xml文件中的 注解配置 配置如下,

Servlet.init() for servlet springMVC threw exception

目录结构如下:

Servlet.init() for servlet springMVC threw exception


发现配置的注解 只控制了controller层,而service层是不会扫描注解的,所以需要修改注解配置为

Servlet.init() for servlet springMVC threw exception

这样整个com.test包都能被注解扫描到


注解参考: http://blog.csdn.net/chunqiuwei/article/details/16115135


相关文章:

  • 2021-10-03
  • 2021-04-25
  • 2021-11-28
  • 2022-01-04
  • 2022-12-23
  • 2021-10-06
  • 2021-11-20
猜你喜欢
  • 2022-01-18
  • 2021-10-28
  • 2021-12-05
  • 2021-07-24
相关资源
相似解决方案