版权声明:如需转载,必须在明显处加以说明,否则视为侵权 https://blog.csdn.net/STUDENTstudent123/article/details/86519275
出现错误:
- DEBUG [main] - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
- DEBUG [main] - Class not found: org.jboss.vfs.VFS
- DEBUG [main] - JBoss 6 VFS API is not available in this environment.
- DEBUG [main] - Class not found: org.jboss.vfs.VirtualFile
- DEBUG [main] - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
- DEBUG [main] - Using VFS adapter org.apache.ibatis.io.DefaultVFS
- DEBUG [main] - Find JAR URL: file:/D:/software%20install/chapter09/build/classes/com/itheima/po
- DEBUG [main] - Not a JAR: file:/D:/software%20install/chapter09/build/classes/com/itheima/po
- DEBUG [main] - Reader entry: idCard.class
- DEBUG [main] - Reader entry: Person.class
- DEBUG [main] - Listing file:/D:/software%20install/chapter09/build/classes/com/itheima/po
- DEBUG [main] - Find JAR URL: file:/D:/software%20install/chapter09/build/classes/com/itheima/po/idCard.class
- DEBUG [main] - Not a JAR: file:/D:/software%20install/chapter09/build/classes/com/itheima/po/idCard.class
----------------------------部分乱字符无法复制 - DEBUG [main] - Checking to see if class com.itheima.po.idCard matches criteria [is assignable to Object]
- DEBUG [main] - Checking to see if class com.itheima.po.Person matches criteria [is assignable to Object]
- DEBUG [main] - PooledDataSource forcefully closed/removed all connections.
- DEBUG [main] - PooledDataSource forcefully closed/removed all connections.
- DEBUG [main] - PooledDataSource forcefully closed/removed all connections.
- DEBUG [main] - PooledDataSource forcefully closed/removed all connections.
- DEBUG [main] - Opening JDBC Connection
- DEBUG [main] - Created connection 1800890735.
- DEBUG [main] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@6b57696f]
- DEBUG [main] - ==> Preparing: select * from tb_person where id=?
- DEBUG [main] - ==> Parameters: 2(Integer)
- DEBUG [main] - ====> Preparing: select * from tb_idcard where id=?
- DEBUG [main] - ====> Parameters: 2(Integer)
- DEBUG [main] - <==== Total: 1
- DEBUG [main] - <== Total: 1
- Person [id=2, name=Tom, age=29, sex=male, card=idCard [id=2, code=440883199808082121]]
- DEBUG [main] - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@6b57696f]
- DEBUG [main] - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@6b57696f]
- DEBUG [main] - Returned connection 1800890735 to pool.
本人在运行mybatis相关代码时,因为这个问题弄了很久才发现,在网上相关的资料比较少,在此分享给大家!欢迎吐槽!!!
错误日志配置:
- # Global logging configuration
- log4j.rootLogger=DEBUG, stdout
- # Console output...
- log4j.appender.stdout=org.apache.log4j.ConsoleAppender
- log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
- log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
正确日志配置:
- # Global logging configuration
- log4j.rootLogger=ERROR, stdout
- # MyBatis logging configuration...
- log4j.logger.com.itheima=DEBUG
- # Console output...
- log4j.appender.stdout=org.apache.log4j.ConsoleAppender
- log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
- log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
原因:少配置的部分是(正确配置部分)第三/第四行代码,以及第二行DEBUG(错误)和ERROR(正确)不同