Hibernate 5 测试的时候日志错误
2023-09-27 14:20:34 时间
运行 Hibernate 测试的时候错误提示:
log4j:WARN No appenders could be found for logger (org.jboss.logging). log4j:WARN Please initialize the log4j system properly. java.lang.NoSuchFieldError: TRACE at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:55) at org.jboss.logging.Log4jLogger.isEnabled(Log4jLogger.java:35) at org.jboss.logging.Logger.isTraceEnabled(Logger.java:98) at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.registerStrategyImplementor(StrategySelectorImpl.java:69) at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.addDialect(StrategySelectorBuilder.java:251) at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.addDialects(StrategySelectorBuilder.java:198) at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.buildSelector(StrategySelectorBuilder.java:163) at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:232) at org.hibernate.cfg.Configuration.<init>(Configuration.java:118) at com.ossez.covid19.common.Factory.initSession(Factory.java:96) at com.ossez.covid19.common.Factory.getFactory(Factory.java:85) at com.ossez.covid19.common.Factory.getSession(Factory.java:75) at com.ossez.covid19.common.Factory.beginTransaction(Factory.java:111) at com.ossez.covid19.tests.Covid19Test.setUp(Covid19Test.java:42) at junit.framework.TestCase.runBare(TestCase.java:132) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) Process finished with exit code -1
这个情况应该是你的依赖中没有 log4j
如果你使用的是 Gradle 的话请添加:
Add org.apache.logging.log4j:log4j-core:2.13.1 到 依赖中。
请参考: OSSEZ-44 - Covid19Test 运行出现日志错误 In Progress
相关文章
- Web Api调用遇到错误提示System.Web.HttpException (0x80004005): The controller for path '' was not found or does not implement IController.
- Hibernate插入错误:GenericJDBCException: could not insert:
- CBUUID UUIDString unrecognized selector sent to instance 错误
- has been modified since the precompiled header地图错误
- Google Earth Engine(GEE)——错误的解决方案(调试方法)!
- 第6周-任务1-使用常对象的一个典型错误
- Nginx的Permission denied错误
- CSDN日报191113:Java 8 Optional 类错误使用的26个示例;Redis常见面试题(带答案)
- js捕获错误
- 如何处理postman Self-signed SSL certificate blocked错误
- 【hacker的错误集】解决response.text获取中文乱码问题
- 【Docker】解决Docker创建Tomcat容器实例后访问Tomcat主页时报HTTP状态404-未找到的错误
- 数据分析应该要避免的6个错误
- mysql中表名是order的CRUD的错误
- 常见Hibernate报错处理:出现“org.hibernate.QueryException: could not resolve property”和 is not mapped和could not locate named parameter错误的解决
- 如何解决svn Authorization failed错误
- pip错误-failed to create process/fatal error in launcher
- [CareerCup] 12.1 Find Mistakes 找程序错误
- Thinkphp 3.2 验证码图片显示错误解决方法