Resin3和4对slf4j的要求

Resin4对 slf4j的要求是version 1.6+,所以如果3换4的话要记得升级jar包,否则活抛异常,异常信息如下:

NoSuchMethodError: StaticLoggerBinder.getSingleton()

对应的org.slf4j.LoggerFactory源码如下:

private final static void bind() {
     try {
       // the next line does the binding
       StaticLoggerBinder.getSingleton();
       INITIALIZATION_STATE = SUCCESSFUL_INITILIZATION;
       emitSubstituteLoggerWarning();
     } catch (NoClassDefFoundError ncde) {
       String msg = ncde.getMessage();
       if (msg != null && msg.indexOf("org/slf4j/impl/StaticLoggerBinder") != -1) {
         INITIALIZATION_STATE = NOP_FALLBACK_INITILIZATION;
         Util
             .report("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".");
         Util.report("Defaulting to no-operation (NOP) logger implementation");
         Util.report("See " + NO_STATICLOGGERBINDER_URL
             + " for further details.");
       } else {
         failedBinding(ncde);
         throw ncde;
       }
     } catch(java.lang.NoSuchMethodError nsme) {
       String msg = nsme.getMessage();
       if (msg != null && msg.indexOf("org.slf4j.impl.StaticLoggerBinder.getSingleton()") != -1) {
         INITIALIZATION_STATE = FAILED_INITILIZATION;
         Util.report("slf4j-api 1.6.x (or later) is incompatible with this binding.");
         Util.report("Your binding is version 1.5.5 or earlier.");
         Util.report("Upgrade your binding to version 1.6.x. or 2.0.x");
       }
       throw nsme;
     } catch (Exception e) {
       failedBinding(e);
       throw new IllegalStateException("Unexpected initialization failure", e);
     }
   }
 
 在进行bind的时候
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值