I am trying to use clj-tika and ring-middleware-logger in the same project. If I use either of them, everything compiles and works as expected.
However, as soon as I start using both at the same time, I am getting this error at compile time:
CompilerException java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder Normally this means that SLF4J is not in the classpath. However, if I do a lein classpath in my project folder, I can clearly see:
C:\Users\Proprietaire\.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.jar So, it should be something else.
Then I ran: mvn dependency:tree to see if there could be SLF4J compatibility issues, and here is what I got for ring-middleware-logger:
[INFO] +- ring.middleware.logger:ring.middleware.logger:jar:0.4.3:compile [INFO] | +- onelog:onelog:jar:0.4.3:compile [INFO] | | +- org.clojure:tools.logging:jar:0.2.3:compile [INFO] | | \- clj-logging-config:clj-logging-config:jar:1.9.6:compile [INFO] | | +- log4j:log4j:jar:1.2.16:compile [INFO] | | \- swank-clojure:swank-clojure:jar:1.3.2:compile [INFO] | \- org.clojars.pjlegato:clansi:jar:1.3.0:compile And for Tika:
[INFO] +- clj-tika:clj-tika:jar:1.2.0:compile [INFO] | \- org.apache.tika:tika-parsers:jar:1.2:compile [INFO] | +- org.apache.tika:tika-core:jar:1.2:compile [INFO] | +- org.gagravarr:vorbis-java-tika:jar:0.1:compile [INFO] | | \- org.gagravarr:vorbis-java-core:jar:tests:0.1:test,provided [INFO] | +- edu.ucar:netcdf:jar:4.2-min:compile [INFO] | | \- org.slf4j:slf4j-api:jar:1.5.6:compile [INFO] | +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile [INFO] | +- org.apache.james:apache-mime4j-dom:jar:0.7.2:compile [INFO] | +- org.apache.commons:commons-compress:jar:1.4.1:compile [INFO] | | \- org.tukaani:xz:jar:1.0:compile [INFO] | +- org.apache.pdfbox:pdfbox:jar:1.7.0:compile [INFO] | | +- org.apache.pdfbox:fontbox:jar:1.7.0:compile [INFO] | | \- org.apache.pdfbox:jempbox:jar:1.7.0:compile [INFO] | +- org.bouncycastle:bcmail-jdk15:jar:1.45:compile [INFO] | +- org.bouncycastle:bcprov-jdk15:jar:1.45:compile [INFO] | +- org.apache.poi:poi:jar:3.8:compile [INFO] | +- org.apache.poi:poi-scratchpad:jar:3.8:compile [INFO] | +- org.apache.poi:poi-ooxml:jar:3.8:compile [INFO] | | +- org.apache.poi:poi-ooxml-schemas:jar:3.8:compile [INFO] | | | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile [INFO] | | \- dom4j:dom4j:jar:1.6.1:compile [INFO] | +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:c ompile [INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile [INFO] | +- asm:asm:jar:3.1:compile [INFO] | +- com.googlecode.mp4parser:isoparser:jar:1.0-RC-1:compile [INFO] | | \- org.aspectj:aspectjrt:jar:1.6.11:compile [INFO] | +- com.drewnoakes:metadata-extractor:jar:2.4.0-beta-1:compile [INFO] | +- de.l3s.boilerpipe:boilerpipe:jar:1.1.0:compile [INFO] | +- rome:rome:jar:0.9:compile [INFO] | | \- jdom:jdom:jar:1.0:compile [INFO] | +- org.gagravarr:vorbis-java-core:jar:0.1:compile [INFO] | \- com.googlecode.juniversalchardet:juniversalchardet:jar:1.0.3:com So, one use LOG4J and the other one SLF4J. If I stop using one of these packages, I do not get that error, as soon as I start using both I start getting the one above...
I am not a Java developer, so I am kind of stuck to fix this error. I have the intuition that I can probably make something available in my classpath or something such that the compiler finds it.
In any case, I am not sure why adding ring-middleware-logger conflict with Tika when none use the same packages (even if they are probably related in ways I don't know).
org.clojure:tools.logging:jarlibrary which is required by the middleware logger application. Then looking at itspom.xmlfile, I see:slf4j-log4j12version1.6.2. Is this what you meant? And could this be the problem? (incompatibility between the two SLF4J versions? If so, how could I fix that?leinis based onmavenso we should be able to fix that the maven way. However, I don't know how this could be done in maven, so I guess this is why I am stuck. So, what I would have to do is to fixtools.logging'spom.xmlfile to use slf4j 1.5.6 instead? Or to updateTikato 1.6.2? (the problem with Tika is that I used its package from a maven repo, so not sure if this can be fixed using maven itself?)