[ 
https://issues.apache.org/jira/browse/TINKERPOP-3014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786945#comment-17786945
 ] 

ASF GitHub Bot commented on TINKERPOP-3014:
-------------------------------------------

Cole-Greer commented on PR #2349:
URL: https://github.com/apache/tinkerpop/pull/2349#issuecomment-1815338173

   Thanks @HappyHacker123, this change looks good to me, VOTE +1.
   
   One thing to note here is that as there are no tests related to this change, 
it's possible that this dependency ordering may be altered in the future, 
unknowingly affecting this change.
   
   As this is a small change, I will merge this in as a CTR (Commit then 
Review), bypassing the standard RTC (Review then Commit) process which requires 
3 approving votes.




> Dependencny jcl-over-slf4j in gremlin-core is declared but unused due to 
> dependency conflict.
> ---------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-3014
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3014
>             Project: TinkerPop
>          Issue Type: Bug
>            Reporter: Weijie Sun
>            Priority: Major
>              Labels: dependency
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> h2. Problem Description
> "gremlin-core" declares "jcl-over-slf4j" as its dependency. However, it seems 
> that the dependency is actually unused due to a dependency conflict.
> There is another dependency "commons-logging:commons-logging" in the 
> dependency tree as listed below:
> {code:java}
> org.apache.tinkerpop:gremlin-core:jar:3.7.0-SNAPSHOT
> \- org.apache.commons:commons-configuration2:jar:2.9.0:compile
>    \- commons-logging:commons-logging:jar:1.2:compile
> \- org.slf4j:jcl-over-slf4j:jar:1.7.33:compile{code}
> The classes in "jcl-over-slf4j" are also in "commons-logging" as listed below:
> {code:java}
> [INFO] org.apache.commons.logging.impl.NoOpLog
> [INFO] org.apache.commons.logging.impl.SimpleLog$1
> [INFO] org.apache.commons.logging.impl.SimpleLog
> [INFO] org.apache.commons.logging.impl.SLF4JLocationAwareLog
> [INFO] org.apache.commons.logging.impl.SLF4JLog
> [INFO] org.apache.commons.logging.impl.SLF4JLogFactory
> [INFO] org.apache.commons.logging.Log
> [INFO] org.apache.commons.logging.LogConfigurationException
> [INFO] org.apache.commons.logging.LogFactory{code}
> The problem is that "commons-logging" is ahead of "jcl-over-slf4j" in the 
> dependency tree, thus ahead of "jcl-over-slf4j" in the classpath. When 
> multiple JAR files contain the same class, the class loader will load the 
> first occurrence it finds based on the classpath order. This means the 
> classloader will select classes in "commons-logging" instead of 
> "jcl-over-slf4j".
> So despite "jcl-over-slf4j" being declared directly, it's actually unused. 
> "commons-logging" is the actual used dependency, causing confusion.
> h2. Possible Solution
> Change the order of "jcl-over-slf4j" and "commons-logging" so that 
> "jcl-over-slf4j" appears ahead of "commons-logging" in the classpath. In this 
> way, "jcl-over-slf4j" is used as intended.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to