2 Replies Latest reply on Oct 22, 2008 11:39 AM by thomas.diesler

    slf4j linking error ?

    tom.baeyens

      I'm going to fix the JcrDbTest. This is the exception it currently generates:

      Did anyone see such a problem before? It seems like a library incompatibility problem to me between slf4j and log4j.

      java.lang.NoSuchFieldError: name
       at org.slf4j.impl.Log4jLoggerAdapter.<init>(Log4jLoggerAdapter.java:75)
       at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:75)
       at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:92)
       at org.apache.jackrabbit.core.config.RepositoryConfig.<clinit>(RepositoryConfig.java:64)
       at org.jbpm.jcr.jackrabbit.JackrabbitJcrServiceFactory.getRepository(JackrabbitJcrServiceFactory.java:48)
       at org.jbpm.jcr.impl.AbstractJcrServiceFactory.openService(AbstractJcrServiceFactory.java:46)
       at org.jbpm.svc.Services.getService(Services.java:156)
       at org.jbpm.jcr.JcrDbTest.testJcrNodeStorageAndRetrieval(JcrDbTest.java:55)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at org.jbpm.AbstractJbpmTestCase.runTest(AbstractJbpmTestCase.java:57)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      




        • 1. Re: slf4j linking error ?
          tom.baeyens

          found this

          I was having the same problem and I solved it by downloading an older
          version of slf4j.


          the version of slf4j-api shipped with hibernate is 1.5.2 (lib/common/
          slf4j-1.5.2.jar)

          I downloaded the same version of slf4j from here: http://www.slf4j.org/dist/
          and the problem is gone.


          here: http://www.velocityreviews.com/forums/t635509-hibernate-tutorial-problem.html

          • 2. Re: slf4j linking error ?
            thomas.diesler

            This is the 'mvn dependency:tree' I used to run the test

            [INFO] ------------------------------------------------------------------------
            [INFO] Building JBoss jBPM3 - Core
            [INFO] task-segment: [dependency:tree]
            [INFO] ------------------------------------------------------------------------
            [INFO] [dependency:tree]
            [INFO] org.jbpm.jbpm3:jbpm-core:jar:3.3.0-SNAPSHOT
            [INFO] +- bsh:bsh:jar:1.3.0:compile
            [INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
            [INFO] +- dom4j:dom4j:jar:1.6.1:compile
            [INFO] +- javax.jcr:jcr:jar:1.0.1:provided
            [INFO] +- javax.mail:mail:jar:1.4:provided
            [INFO] | \- javax.activation:activation:jar:1.1:provided
            [INFO] +- javax.servlet:servlet-api:jar:2.5:provided
            [INFO] +- junit:junit:jar:3.8.1:compile
            [INFO] +- org.apache.ant:ant:jar:1.7.0:compile
            [INFO] | \- org.apache.ant:ant-launcher:jar:1.7.0:compile
            [INFO] +- org.apache.jackrabbit:jackrabbit-core:jar:1.4.5:compile
            [INFO] | +- concurrent:concurrent:jar:1.3.4:compile
            [INFO] | +- commons-collections:commons-collections:jar:3.1:compile
            [INFO] | +- org.apache.jackrabbit:jackrabbit-api:jar:1.4:compile
            [INFO] | +- org.apache.jackrabbit:jackrabbit-jcr-commons:jar:1.4:compile
            [INFO] | +- org.apache.jackrabbit:jackrabbit-spi-commons:jar:1.4:compile
            [INFO] | +- org.apache.jackrabbit:jackrabbit-spi:jar:1.4:compile
            [INFO] | +- org.apache.jackrabbit:jackrabbit-text-extractors:jar:1.4:compile
            [INFO] | | +- org.apache.poi:poi:jar:3.0.2-FINAL:compile
            [INFO] | | +- pdfbox:pdfbox:jar:0.6.4:compile
            [INFO] | | +- org.textmining:tm-extractors:jar:0.4:compile
            [INFO] | | +- nekohtml:nekohtml:jar:0.9.4:compile
            [INFO] | | \- xerces:xercesImpl:jar:2.6.2:compile
            [INFO] | | \- xml-apis:xml-apis:jar:1.3.02:compile
            [INFO] | +- org.apache.lucene:lucene-core:jar:2.2.0:compile
            [INFO] | \- org.apache.derby:derby:jar:10.2.1.6:compile
            [INFO] +- org.hibernate:hibernate:jar:3.2.6.ga:compile
            [INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:compile
            [INFO] | +- javax.transaction:jta:jar:1.0.1B:compile
            [INFO] | +- asm:asm-attrs:jar:1.5.3:compile
            [INFO] | +- antlr:antlr:jar:2.7.6:compile
            [INFO] | +- cglib:cglib:jar:2.1_3:compile
            [INFO] | \- asm:asm:jar:1.5.3:compile
            [INFO] +- org.slf4j:slf4j-api:jar:1.5.5:compile
            [INFO] +- dumbster:dumbster:jar:1.6:test
            [INFO] +- jaxen:jaxen:jar:1.1.1:test
            [INFO] | +- jdom:jdom:jar:1.0:test
            [INFO] | \- xom:xom:jar:1.0:test
            [INFO] | +- xerces:xmlParserAPIs:jar:2.6.2:test
            [INFO] | +- xalan:xalan:jar:2.6.0:test
            [INFO] | \- com.ibm.icu:icu4j:jar:2.6.1:test
            [INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.5:test
            [INFO] +- hsqldb:hsqldb:jar:1.8.0.7:test
            [INFO] \- log4j:log4j:jar:1.2.14:test (scope not updated to runtime)
            [INFO] ------------------------------------------------------------------------
            [INFO] BUILD SUCCESSFUL
            [INFO] ------------------------------------------------------------------------
            


            Note, it uses sl4j-1.5.5

            [tdiesler@tdvaio trunk]$ svn log -v -r2585
            ------------------------------------------------------------------------
            r2585 | thomas.diesler@jboss.com | 2008-10-22 16:09:27 +0200 (Wed, 22 Oct 2008) | 1 line
            Changed paths:
             M /jbpm3/trunk/modules/core/pom.xml
             M /jbpm3/trunk/pom.xml
            
            [JBPM-1720] update to sl4j-1.5.5
            


            With sl4j-1.5.5 in place the issue does not show any more - for me.

            Also see

            https://jira.jboss.org/jira/browse/JBPM-1720