Uploaded image for project: 'logback-audit'
  1. logback-audit
  2. LBAUDIT-5

Logback and Logback-audit don't seem to be compatible when used in the same project

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.6
    • None
    • Eclipse JUnit

    Description

      using <logback.version>1.1.2</logback.version>
      and <logback.audit.version>0.6</logback.audit.version>
      in a single project I see the following error:

      java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/Pattern
      at ch.qos.logback.audit.client.joran.JoranConfigurator.addInstanceRules(JoranConfigurator.java:38)
      at ch.qos.logback.core.joran.GenericConfigurator.buildInterpreter(GenericConfigurator.java:116)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:146)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
      at ch.qos.logback.audit.client.AuditorFactory.configureByResource(AuditorFactory.java:128)
      at com.monitise.mvp.common.auditing.MvpAuditProcessorImpl.writeToAuditLog(MvpAuditProcessorImpl.java:95)
      at com.monitise.mvp.common.auditing.MvpAuditProcessorImpl.auditMessage(MvpAuditProcessorImpl.java:65)
      at com.monitise.mvp.common.auditing.MvpAbstractAuditor.audit(MvpAbstractAuditor.java:39)
      at com.monitise.mvp.common.aspect.AuditorAspectTest.auditMethod_aroundBody1$advice(AuditorAspectTest.java:44)
      at com.monitise.mvp.common.aspect.AuditorAspectTest.auditMethod(AuditorAspectTest.java:1)
      at com.monitise.mvp.common.aspect.AuditorAspectTest.test(AuditorAspectTest.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      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.ClassNotFoundException: ch.qos.logback.core.joran.spi.Pattern
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 37 more

      I believe this is because the Pattern class is part of the 0.9 version of logback-core and the name was changed in later versions. I tried creating a facade for the Pattern class but issues in other transitive dependencies then started showing up.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            peekay21 Al Dispennette
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: