Servlet[springmvc]的Servlet.init()引发异常

Servlet[springmvc]的Servlet.init()引发异常

分析:Maven项目,application-context.xml、db.properties文件均放置在src/main/resources目录下,Tomcat部署项目,src/main/resources目录下的配置文件默认位置为:{项目名}/WEB-INF/classes,而Spring却在项目根目录下寻找,肯定找不到,因此,配置时指定classpath目录下寻找即可。

解决方案如下:

<context:property-placeholder location=“classpath:db.properties” />

相关文章:

  • 2022-01-18
  • 2021-10-28
  • 2021-08-22
  • 2021-12-05
  • 2021-07-24
猜你喜欢
  • 2021-12-05
  • 2021-11-10
  • 2021-04-11
  • 2021-12-05
相关资源
相似解决方案