SSM报错:Could not load properties; nested exception is java.io.FileNotFoundException...

启动tomcat时,报了一个 找不到文件,无法打开resource 下的连接数据库文件的错误。

上网查了一下,原来是在applicationContext.xml文件中导入jdbc文件时没有加上classpath:

加上

原本以为完事,一启动tomcat又出了一个问题:

Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/mybatis-config.xml]

报了一个找不到mybatis文件的错误。

接着回到导入mybatis文件的位置

SSM报错:Could not load properties; nested exception is java.io.FileNotFoundException..._第1张图片

加上classpath

SSM报错:Could not load properties; nested exception is java.io.FileNotFoundException..._第2张图片

再重新启动tomcat

SSM报错:Could not load properties; nested exception is java.io.FileNotFoundException..._第3张图片

写好路径,很好 结果出来了。

SSM报错:Could not load properties; nested exception is java.io.FileNotFoundException..._第4张图片

你可能感兴趣的:(tomcat,tomcat)