V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
skt041959
V2EX  ›  Java

Java 小白求问

  •  
  •   skt041959 · 2017-07-24 23:10:26 +08:00 · 2021 次点击
    这是一个创建于 2656 天前的主题,其中的信息可能已经有所发展或是发生改变。
    backtrace:
    java.lang.ExceptionInInitializerError
    at com.*******.integ.dal.Module.<init>(Module.java:45)
    at com.*******.integ.dal.Module.<clinit>(Module.java:42)
    at com.*******.integ.dal.DalInit.<clinit>(DalInit.java:29)
    at com.*******.******.********.monitor.workflow.WorkflowConfigConverterTest.setUp(WorkflowConfigConverterTest.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: java.lang.ClassCastException: org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger
    at com.*******.kernel.logger.Logger.<init>(Logger.java:125)
    at com.*******.kernel.logger.Logger.getInstance(Logger.java:103)
    at com.*******.kernel.logger.Logger.getInstance(Logger.java:91)
    at com.*******.kernel.initialization.BaseInitializationManager.<clinit>(BaseInitializationManager.java:22)
    ... 26 more


    Console Output:
    SLF4J: No SLF4J providers were found.
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
    SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8.
    SLF4J: Ignoring binding found at [jar:file:/C:/.m2/raptor2/ch/qos/logback/logback-classic/1.0.11/logback-classic-1.0.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Ignoring binding found at [jar:file:/C:/.m2/raptor2/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.


    请问是什么问题?
    我查了查貌似是版本更新后出现了依赖问题?
    应该怎么改?
    2 条回复    2017-07-25 01:01:55 +08:00
    RLib
        1
    RLib  
       2017-07-24 23:17:04 +08:00
    Caused by: java.lang.ClassCastException: org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger

    这才是重点
    340244120
        2
    340244120  
       2017-07-25 01:01:55 +08:00 via Android
    最后几行的 ignore 提示你 sl4j 的实现类重复了。你同时用了 logback 和 lig4j
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1263 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:18 · PVG 07:18 · LAX 16:18 · JFK 19:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.