SLF4J版本兼容问题

struts-2.3.8,spring 3.2.1,hibernate-distribution-3.6.6.Final,displytag 1.2,整合,遇到以下SLF4J问题:
【现象一】
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
     at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error( SLF4JLocationAwareLog.java:173 )

【现象二】
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
2013-3-19 17:12:31 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;

【原因及解决办法】
原因就是slf4j-api-1.6.6.jar、slf4j-log4j12-1.6.6.jar、jcl-over-slf4j-1.6.6.jar  这3个JAR包的版本不同。

【C3P0错误】
将上述3个包统一版本后,又发生了如下异常:
2013-03-19 19:40:44,340 - org.hibernate.util.JDBCExceptionReporter -625  [Thread-5] ERROR  - An attempt by a client to checkout a Connection has timed out.
2013-03-19 19:40:44,465 - org.hibernate.cfg.SettingsFactory -750  [Thread-5] WARN   - Could not obtain connection to query metadata
java.sql.SQLException   : An attempt by a client to checkout a Connection has timed out.

原因及解决办法
在ApplicationContext.xml中设置属性 checkoutTimeout的值过小,修改为默认值0,问题解决!
<property name="checkoutTimeout" value="0"/>


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值