MyBatis日誌log4j異常ERROR Could not instantiate class [org.apache.ibatis.session.AutoMappingUnknownColum
具體異常:
log4j:ERROR Could not instantiate class [org.apache.ibatis.session.AutoMappingUnknownColumnBehaviorTest$LastEventSavedAppender].
java.lang.ClassNotFoundException: org.apache.ibatis.session.AutoMappingUnknownColumnBehaviorTest$LastEventSavedAppender
異常分析:無法將org.apache.ibatis.session.AutoMappingUnknownColumnBehaviorTest例項化為LastEventSavedAppender
實際原因:直接把mybatis目錄下的官方log4j.properties直接拿來用了,下圖是官方資源的log4j.properties
(mybatis-3-mybatis-x.x..x src\test\java目錄下)
解決方法:把WARN後的內容去掉
檢視官方網址(http://www.mybatis.org/mybatis-3/configuration.html)也可知AutoMappingUnkownColumnBehavior只可取NONE,WARNING,FAILING三個值,預設值為NONE