[
https://issues.apache.org/jira/browse/JCR-4796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17553061#comment-17553061
]
Graham Leggett commented on JCR-4796:
-------------------------------------
There is nothing funny about this.
Here are the google results for class conflicts:
[https://www.google.com/search?q=slf4j+class+conflict]
Two thousand views on
[https://stackoverflow.com/questions/59103040/conflicts-with-logs-libraries-class-path-contains-multiple-slf4j-bindings,]
and approaching a thousand views on
[https://stackoverflow.com/questions/53874661/slf4j-logback-loggercontext-conflicts.]
What does slf4j give you that justifies this level of inconvenience?
I worked around this in the immediate term by the following exclusion, whether
this will work on a production tomcat 8.5 I do not yet know:
{code:java}
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr2dav</artifactId>
<version>2.21.12-SNAPSHOT</version>
<!-- <scope>provided</scope> -->
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-spi2dav</artifactId>
<version>2.21.12-SNAPSHOT</version>
<!-- <scope>provided</scope> -->
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency> {code}
> Remove slf4j from Jackrabbit libraries
> --------------------------------------
>
> Key: JCR-4796
> URL: https://issues.apache.org/jira/browse/JCR-4796
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Reporter: Graham Leggett
> Priority: Major
>
> Life is too short to deal with exceptions like this one:
> java.lang.LinkageError: loader constraint violation: when resolving method
> 'org.slf4j.ILoggerFactory
> org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()' the class loader
> org.apache.catalina.loader.ParallelWebappClassLoader @4bd217c of the current
> class, org/slf4j/LoggerFactory, and the class loader java.net.URLClassLoader
> @7907ec20 for the method's defining class, org/slf4j/impl/StaticLoggerBinder,
> have different Class objects for the type org/slf4j/ILoggerFactory used in
> the signature (org.slf4j.LoggerFactory is in unnamed module of loader
> org.apache.catalina.loader.ParallelWebappClassLoader @4bd217c, parent loader
> java.net.URLClassLoader @7907ec20; org.slf4j.impl.StaticLoggerBinder is in
> unnamed module of loader java.net.URLClassLoader @7907ec20, parent loader
> 'app')
> Remove slf4j and replace with the java default behaviour.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)