整合ssm遇到的异常

1.SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" 

缺少slf4j模块的依赖,所以需要在pom文件中添加相应的依赖。

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>${slf4j.version}</version>
</dependency>

2. Caused by: java.lang.IllegalStateException: SpringJUnit4ClassRunner requires JUnit 4.12 or higher.

 告诉我们junit测试jar依赖包版本太低了

 

<dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>4.12</version>
</dependency>

 3.java.lang.ExceptionInInitializerError

      jar包版本冲突或者不统一,我整合spring时,添加的一个jar跟其他的不是同一个版本号,故此改成统一的即可。

4.Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dao.PersonDao.selectAll

命名空间忘记修改

5. java.lang.Object.wait(Native Method)未解决(关闭tomcat时出现此异常,不影响正常使用)

 <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.8.5</version>
</dependency>

 

12-Aug-2019 22:29:09.670 璀﹀憡 [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [SSM] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
 com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值