SSM 错误集锦

  1. class path resource [spring/] cannot be resolved to URL because it does not exist
  • 条件:这是非编译情况下利用mvn的插件war:war生成war包,运行后所报的错误。
  • 原因:未将resources下的配置文件引入war包中。
  • 解决方法:先执行代码,再生成war包。
  1. check the manual that corresponds to your MySQL server version for the right syntax to use near … , The error may involve .insert-Inline
  • 原因:mysql 向数据库插入数据时错误, 可能触及到mysql的保留字,例如 key。
  • 解决办法: 插入语句不能起别名,该方式不可取。加键盘左上角的撇号,例key
  1. java.lang.Double cannot be cast to java.lang.String
    list中查出来个别数据是 double,转换为 String。
    String periodTime = String.valueOf(list.get(0));

  2. Error running ‘tomcat’: Can’t find catalina.jar

  • 原因:tomcat 升级导致路径改变
  • 解决办法:Idea 在 Edit Configuration 中修改 tomcat 路径至 libexec