You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, in KafkaExample-master/demokafka.0.10.1.0, there are mulptiple versions of library org.xerial.snappy:snappy-java. However, according to Maven's dependency management strategy: "first declaration wins", only org.xerial.snappy:snappy-java:1.1.1.6 can be loaded, and org.xerial.snappy:snappy-java:1.1.2.6 will be shadowed.
In total, there are 5 conflicting API pairs between these two library version.
As shown in the following figure, your project expects to invoke method <org.xerial.snappy.SnappyOutputStream: write([BII)V> in library org.xerial.snappy:snappy-java:1.1.2.6 (along the original dependency path). As it has been shadowed, this method defined in org.xerial.snappy:snappy-java:1.1.1.6 is actually forced to be referenced via the following invocation path (along the actual dependency path):
Although both of these conflicting libraries contain the referenced methods (with the same signature), they have different implementations. This issue will not cause runtime crashes, but it can introduce inconsistent semantic program hehaviors----
Code snippet of <org.xerial.snappy.SnappyOutputStream: write([BII)V> in org.xerial.snappy:snappy-java:1.1.2.6 (shadowed but expected to invoke method):
detailed method body
@Overridepublicvoidwrite(byte[] b, intbyteOffset, intbyteLength)
throwsIOException
{
if (closed) {
thrownewIOException("Stream is closed");
}
intcursor = 0;
while (cursor < byteLength) {
intreadLen = Math.min(byteLength - cursor, blockSize - inputCursor);
// copy the input data to uncompressed bufferif (readLen > 0) {
System.arraycopy(b, byteOffset + cursor, inputBuffer, inputCursor, readLen);
inputCursor += readLen;
}
if (inputCursor < blockSize) {
return;
}
compressInput();
cursor += readLen;
}
}
Code snippet of <org.xerial.snappy.SnappyOutputStream: write([BII)V> in org.xerial.snappy:snappy-java:1.1.1.6 (loaded version):
[INFO] com.jasongj.kafka:demokafka.0.10.1.0:jar:0.10.1.0
[INFO] +- org.apache.kafka:kafka_2.11:jar:0.10.1.0:compile
[INFO] | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:4.9:compile
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | | - (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted for conflict with 1.7.21)
[INFO] | +- (org.scala-lang:scala-library:jar:2.11.8:compile - omitted for conflict with 2.11.5)
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | | - (log4j:log4j:jar:1.2.17:compile - omitted for duplicate)
[INFO] | +- (org.apache.zookeeper:zookeeper:jar:3.4.8:compile - omitted for conflict with 3.4.6)
[INFO] | - org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | - (org.scala-lang:scala-library:jar:2.11.6:compile - omitted for conflict with 2.11.8)
[INFO] +- org.apache.kafka:kafka-clients:jar:0.10.1.0:compile
[INFO] | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] | +- (org.xerial.snappy:snappy-java:jar:1.1.2.6:compile - omitted for conflict with 1.1.1.6)
[INFO] | - org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.kafka:kafka-streams:jar:0.10.1.0:compile
[INFO] | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | +- org.apache.kafka:connect-json:jar:0.10.1.0:compile
[INFO] | | +- org.apache.kafka:connect-api:jar:0.10.1.0:compile
[INFO] | | | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | | | - (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.6.3:compile - omitted for duplicate)
[INFO] | | - (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | +- org.rocksdb:rocksdbjni:jar:4.9.0:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | - com.fasterxml.jackson.core:jackson-databind:jar:2.6.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
[INFO] | - com.fasterxml.jackson.core:jackson-core:jar:2.6.3:compile
[INFO] +- com.101tec:zkclient:jar:0.10:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | - (org.apache.zookeeper:zookeeper:jar:3.4.8:compile - omitted for duplicate)
[INFO] +- commons-io:commons-io:jar:2.5:compile
[INFO] +- junit:junit:jar:4.11:test (scope not updated to compile)
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- com.google.guava:guava:jar:14.0-rc1:compile
[INFO] +- org.scala-lang:scala-library:jar:2.11.5:compile
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | +- (org.slf4j:slf4j-log4j12:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | +- (log4j:log4j:jar:1.2.16:compile - omitted for conflict with 1.2.17)
[INFO] | +- jline:jline:jar:0.9.94:compile
[INFO] | | - (junit:junit:jar:3.8.1:compile - omitted for conflict with 4.11)
[INFO] | - io.netty:netty:jar:3.7.0.Final:compile
[INFO] +- org.xerial.snappy:snappy-java:jar:1.1.1.6:compile
[INFO] - org.apache.commons:commons-lang3:jar:3.5:compile
Suggested solutions:
Solution1: Declare version org.xerial.snappy:snappy-java:1.1.2.6 as a direct dependency, to override the version 1.1.1.6 (based on Maven's nearest wins loading strategy).
Solution2: Remove the conflicting Jars.
Thanks.
Best regards,
Coco
The text was updated successfully, but these errors were encountered:
Hi, in KafkaExample-master/demokafka.0.10.1.0, there are mulptiple versions of library org.xerial.snappy:snappy-java. However, according to Maven's dependency management strategy: "first declaration wins", only org.xerial.snappy:snappy-java:1.1.1.6 can be loaded, and org.xerial.snappy:snappy-java:1.1.2.6 will be shadowed.
In total, there are 5 conflicting API pairs between these two library version.
As shown in the following figure, your project expects to invoke method <org.xerial.snappy.SnappyOutputStream: write([BII)V> in library org.xerial.snappy:snappy-java:1.1.2.6 (along the original dependency path). As it has been shadowed, this method defined in org.xerial.snappy:snappy-java:1.1.1.6 is actually forced to be referenced via the following invocation path (along the actual dependency path):
Although both of these conflicting libraries contain the referenced methods (with the same signature), they have different implementations. This issue will not cause runtime crashes, but it can introduce inconsistent semantic program hehaviors----
Code snippet of <org.xerial.snappy.SnappyOutputStream: write([BII)V> in org.xerial.snappy:snappy-java:1.1.2.6 (shadowed but expected to invoke method):
detailed method body
Code snippet of <org.xerial.snappy.SnappyOutputStream: write([BII)V> in org.xerial.snappy:snappy-java:1.1.1.6 (loaded version):
detailed method body
The detailed informantion of the remaining 4 conflicting API pairs can be found in the following attachment.
5 conflicting API pairs in project demokafka.txt
Dependency tree--
[INFO] com.jasongj.kafka:demokafka.0.10.1.0:jar:0.10.1.0
[INFO] +- org.apache.kafka:kafka_2.11:jar:0.10.1.0:compile
[INFO] | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:4.9:compile
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | | - (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted for conflict with 1.7.21)
[INFO] | +- (org.scala-lang:scala-library:jar:2.11.8:compile - omitted for conflict with 2.11.5)
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | | - (log4j:log4j:jar:1.2.17:compile - omitted for duplicate)
[INFO] | +- (org.apache.zookeeper:zookeeper:jar:3.4.8:compile - omitted for conflict with 3.4.6)
[INFO] | - org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | - (org.scala-lang:scala-library:jar:2.11.6:compile - omitted for conflict with 2.11.8)
[INFO] +- org.apache.kafka:kafka-clients:jar:0.10.1.0:compile
[INFO] | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] | +- (org.xerial.snappy:snappy-java:jar:1.1.2.6:compile - omitted for conflict with 1.1.1.6)
[INFO] | - org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.kafka:kafka-streams:jar:0.10.1.0:compile
[INFO] | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | +- org.apache.kafka:connect-json:jar:0.10.1.0:compile
[INFO] | | +- org.apache.kafka:connect-api:jar:0.10.1.0:compile
[INFO] | | | +- (org.apache.kafka:kafka-clients:jar:0.10.1.0:compile - omitted for duplicate)
[INFO] | | | - (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.6.3:compile - omitted for duplicate)
[INFO] | | - (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - omitted for duplicate)
[INFO] | +- org.rocksdb:rocksdbjni:jar:4.9.0:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | - com.fasterxml.jackson.core:jackson-databind:jar:2.6.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
[INFO] | - com.fasterxml.jackson.core:jackson-core:jar:2.6.3:compile
[INFO] +- com.101tec:zkclient:jar:0.10:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | - (org.apache.zookeeper:zookeeper:jar:3.4.8:compile - omitted for duplicate)
[INFO] +- commons-io:commons-io:jar:2.5:compile
[INFO] +- junit:junit:jar:4.11:test (scope not updated to compile)
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- com.google.guava:guava:jar:14.0-rc1:compile
[INFO] +- org.scala-lang:scala-library:jar:2.11.5:compile
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | +- (org.slf4j:slf4j-log4j12:jar:1.6.1:compile - omitted for conflict with 1.7.21)
[INFO] | +- (log4j:log4j:jar:1.2.16:compile - omitted for conflict with 1.2.17)
[INFO] | +- jline:jline:jar:0.9.94:compile
[INFO] | | - (junit:junit:jar:3.8.1:compile - omitted for conflict with 4.11)
[INFO] | - io.netty:netty:jar:3.7.0.Final:compile
[INFO] +- org.xerial.snappy:snappy-java:jar:1.1.1.6:compile
[INFO] - org.apache.commons:commons-lang3:jar:3.5:compile
Suggested solutions:
Solution1: Declare version org.xerial.snappy:snappy-java:1.1.2.6 as a direct dependency, to override the version 1.1.1.6 (based on Maven's nearest wins loading strategy).
Solution2: Remove the conflicting Jars.
Thanks.
Best regards,
Coco
The text was updated successfully, but these errors were encountered: