1. 程式人生 > >MyBatis日誌log4j異常ERROR Could not instantiate class [org.apache.ibatis.session.AutoMappingUnknownColum

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

相關推薦

MyBatis日誌log4j異常ERROR Could not instantiate class [org.apache.ibatis.session.AutoMappingUnknownColum

具體異常: log4j:ERROR Could not instantiate class [org.apache.ibatis.session.AutoMappingUnknownColumnBeh

【原】Could not initialize class org.apache.log4j.Log4jLoggerFactory

考題 ted log clas .com alt 代碼 light nbsp 現象:正常運行的項目,從Jenkins遷到容器雲上不能正常啟動,報錯誤如下: Caused by: java.lang.NoClassDefFoundError: Could not ini

spring boot 集成axis1.4 java.lang.NoClassDefFoundError: Could not initialize class org.apache.axis.client.AxisClient

could not cli PC com 定義 logging axis found 調用 pom配置: <dependencies> <dependency> <groupId>org.springframewor

Could not initialize class org.apache.xpath...

IDEA Maven Tomcat 啟動問題 ■現象Eclipse / IDEA Tomcat無法啟動 [2018/04/26 14:42:24.893][RMI TCP Connection(3)-127.0.0.1] WARN o.s.b.f.s.DefaultListableBeanF

java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.el.ELContextImpl

需要在家裡把一個小web專案收尾,但家裡的電腦沒有intellij,需要在命令列手動編譯,嫌在命令列輸入classpath麻煩,所以直接把servlet-api.jar和jsp-api.jar放到了%J

Mybatis懶載入時,springMVC返回JSON異常 Could not write JSON: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$En

在mybatis整合springmvc時,假如mybatis採用了懶載入,而springmvc中利用@ResponseBody註解返回實體類的JSON時會拋異常: Could not write JSON: No serializer found for class org.apache.ibatis.ex

【Hibernate】could not instantiate class.. from tuple] with root cause

使用hibernate的過程中出現了這個問題,查詢語句如下: 1 String hql = "select new GoodsBean(id, name, price, proPic, sales, updatetime, marketReferencePrice) from GoodsBean wh

使用powerdesigner連線資料庫時出現Non SQL Error : Could not load class com.mysql.jdbc.Drive

Non SQL Error : Could not load class com.mysql.jdbc.Driver 這是因為powerdesigner 無法找到驅動所產生的 解決辦法是:配置系統的classpath 路徑,指定jar 包路徑就好了。 貌似要重啟下powerdesigner,否則還

關於 Unable to load class 'kotlin.collections.CollectionsKT' 或Error:Could not initialize class or報錯記錄

關於Error:Could not initialize class org.jetbrains.kotlin.kapt.idea.KaptModelBuilderService或者Unable to load class 'kotlin.collections.Collec

解決創建maven項目Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart問題

下載 -1 mage could nbsp ould pes 最新版 apach 今天用eclipse創建項目的時候報錯如下圖: 解決方案: 1.下載最新版maven-archetype-quickstart-1.1.jar 2.命令行到下載目錄下執行mvn i

Maven 項目創建時遇到問題 (Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.)

href .html 圖片 config pos maven 沒有 web con 解決辦法:配置一下 maven阿裏雲鏡像,親測有效,完美解決! 配置教程: http://blog.java1234.com/blog/articles/252.html 試過網上的

建立maven專案的時候:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories. 解決辦法

問題:      https://yq.aliyun.com/ziliao/364921      嘗試沒成功。 https://www.aliyun.com/jiaocheng/296712.html   嘗試沒成功。

【原創】經驗分享(10)Could not transfer artifact org.apache.maven:maven. from/to central. Received fatal alert: protocol_version

maven編譯工程報錯 [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:add-source (scala-compile-first) on project trade: Execution sca

關於SSH整合的測試Could not initialize class org.springframework.test.context.junit4.SpringJUnit4ClassRunner

在構建SSH整合的時候,測試類啟動初始化報錯 實際上是少了一個包hibernate-commons-annotations-4.0.1.Final.jar,加入對應版本的jar包即可,百度大部分說的問題是針對maven的,而我寫的這個是關於SSH的,沒有maven管理

java.lang.NoClassDefFoundError: Could not initialize class org.springframework.beans.factory.BeanCre

錯誤描述: Exception in thread “main” java.lang.NoClassDefFoundError: Could not initialize class org.springframework.beans.factory.BeanCreationExce

使用Eclipse的hibernate外掛進行工程反轉生成po類Could not initialize class org.hibernate.cfg.reveng.OverrideReposity

hibernate外掛是適合Eclipse版本的最新版本,工程反轉使用的hibernate3.6 使用Eclipse的hibernate外掛進行工程反轉生成po類時報錯: org.hibernate.console.HibernateConsoleRun

Eclipse使用Maven建立Web時錯誤:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

     如圖:接下來在使用剛新增的catalog建立web工程          這個時候就可以看到Eclipse聯網下載了:     這個時候看一下是不是建立成功了如果還是不能建立或者問題沒有解決可以安裝下面的方法:1.刪除maven已經下載的檔案路徑:.m2\repository\org\apache\

Maven 報:Could not find artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3

前些時候我學習Maven,我遇到了以下兩個錯誤(該死的這兩個錯誤,讓我浪費了四天時間): 1、Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the conf

mybatis-plus呼叫自身的 selectById 方法報錯:org.apache.ibatis.binding.BindingException:

  mybatis-plus的版本號是 2.0.1,在呼叫自身的insert(T)的時候沒有報錯,但是執行update報錯,呼叫selectById、deleteById的時候也報錯。也就是涉及到需要主鍵識別的都報錯。 語句如下:(介面與實現都是MP自己實現的) User

關於SpringBoot整合MyBatis+微信小程式出現的問題(org.apache.ibatis.binding.BindingException: Invalid bound stat)解決方案

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 錯誤解釋為:無效的繫結語句。一、普通問題的