Resin3和4对slf4j的要求 博客分类: Java
程序员文章站
2024-02-25 22:48:03
...
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的时候
推荐阅读
-
Resin3和4对slf4j的要求 博客分类: Java
-
不常用的关键字transient,volatile和strictfp 博客分类: Java
-
一位10年Java工作经验的架构师聊Java和工作经验 博客分类: javaweb javaweb工作经验
-
Java获取jsp中的值和jsp中获取Java中的值 博客分类: jsp jspjava值
-
swing 文本域的undo和右键开始菜单 博客分类: java swingJava undo文本域右键菜单JPopupMenuUndoManager
-
dom4j创建xml和读取xml的demo 博客分类: java基础 dom4jxmlSAXReader
-
浅谈对jdbc和jtds的一些认识 博客分类: java JDBCCC++C#SQL Server
-
[转载]Java 专业人士必备的书籍和网站列表 博客分类: 编程技术 Java出版编程Eclipse设计模式
-
&&运算符和||运算符的优先级问题 博客分类: Java 虚拟机JDK单元测试JVMGoogle
-
&&运算符和||运算符的优先级问题 博客分类: Java 虚拟机JDK单元测试JVMGoogle