Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with dependency kafka-avro-serializer #29

Closed
simplesteph opened this issue Oct 5, 2017 · 6 comments
Closed

Does not work with dependency kafka-avro-serializer #29

simplesteph opened this issue Oct 5, 2017 · 6 comments

Comments

@simplesteph
Copy link

When you include

       <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-avro-serializer</artifactId>
            <!-- For CP 3.3.0 -->
            <version>3.3.0</version>
        </dependency>

one gets

Exception in thread "Thread-0" java.lang.NoSuchFieldError: configFileStr
        at org.apache.curator.test.QuorumConfigBuilder$1.<init>(QuorumConfigBuilder.java:142)
        at org.apache.curator.test.QuorumConfigBuilder.buildConfig(QuorumConfigBuilder.java:137)
        at org.apache.curator.test.TestingZooKeeperServer$1.run(TestingZooKeeperServer.java:157)
        at java.lang.Thread.run(Thread.java:748)

Is it possible to get official guidance to make the two libraries co-exist?

@charithe
Copy link
Owner

charithe commented Oct 5, 2017

It sounds like the Avro serializer library has a transitive dependency on Curator. Try adding an exclusion rule to the dependency declaration.

@simplesteph
Copy link
Author

Do you have a working example? I'm not sure how to do that. I think that's something that should be documented on your front page as well because I'm sure other people will encounter that issue.

And I don't see Curator here unfortunately :(

mvn dependency:tree 
[INFO] +- io.confluent:kafka-avro-serializer:jar:3.3.0:compile
[INFO] |  +- org.apache.avro:avro:jar:1.8.2:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] |  |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] |  |  +- com.thoughtworks.paranamer:paranamer:jar:2.7:compile
[INFO] |  |  +- org.xerial.snappy:snappy-java:jar:1.1.1.3:compile
[INFO] |  |  +- org.apache.commons:commons-compress:jar:1.8.1:compile
[INFO] |  |  \- org.tukaani:xz:jar:1.5:compile
[INFO] |  +- io.confluent:kafka-schema-registry-client:jar:3.3.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO] |  |  \- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] |  |     \- log4j:log4j:jar:1.2.17:compile
[INFO] |  +- io.confluent:common-config:jar:3.3.0:compile
[INFO] |  \- io.confluent:common-utils:jar:3.3.0:compile
[INFO] |     +- org.apache.zookeeper:zookeeper:jar:3.4.8:compile
[INFO] |     |  +- jline:jline:jar:0.9.94:compile
[INFO] |     |  \- io.netty:netty:jar:3.7.0.Final:compile
[INFO] |     \- com.101tec:zkclient:jar:0.10:compile

@simplesteph
Copy link
Author

simplesteph commented Oct 5, 2017

I think the issue is that you're targetting curator-test 4.0.0. This dependency is on Zookeeper 3.5.x, which is not the zookeeper supported by Kafka.

Maybe try downgrading to curator-test 2.12.0, which supports Zookeeper 3.4.x?

@charithe
Copy link
Owner

charithe commented Oct 6, 2017

Ah, it must be the transitive dependency on Zookeeper. Try excluding that from the Avro dependency.

<dependency>
    <groupId>io.confluent</groupId>
    <artifactId>kafka-avro-serializer</artifactId>
    <version>3.3.0</version>
    <exclusions>
         <exclusion>
             <groupId>org.apache</groupId>
             <artifactId>zookeeper</artifactId>
         </exclusion>
    </exclusions>
</dependency>

I'd rather not downgrade Curator now because it could cause a lot of existing code to break.

@simplesteph
Copy link
Author

simplesteph commented Oct 10, 2017

According to https://mvnrepository.com/artifact/org.apache.curator/curator-test
2.12 and 3.3.0 were both released in March 2017.
2.12 targets zookeeper 3.4.x, the branch Kafka uses.
3.3.0 targets zookeeper 3.5.x, currently in beta and not working with Kafka

It seems curator-test was upgraded to 4.0.0 as part of this commit: 89bfeed Although I'm not sure if there's any reason why it has.

Bottom line, I believe downgrading to 2.12 is both safer and more sound based on matching the kafka zookeeper client version. It also prevents projects onboarding this library from having zookeeper clients in version beta 3.5.x, which could be a serious risk

In #30 Jenkins tested the project itself and it passes its own test suite, which is a pretty good indication the downgrade shouldn't break anything

I think it's still time to make a good decision for this project to follow the 2.x branch of curator-test. If you don't agree with me that's fine I won't insist :) Hope you understand my point of view

@charithe
Copy link
Owner

It's been a while so I can't remember the reason for the upgrade. My fear is that the 3.x version has been out for a long time and by suddenly downgrading one of the dependencies, I could break existing code that may be accidentally (or, indeed, intentionally) relying on it. As this is a minor dependency conflict with a supporting Kafka library, I don't feel like a downgrade is justified here.

If you're uncomfortable with the dependency versions, feel free to keep your fork up. The code is Apache licensed and any future updates are most likely to be just Kafka version updates anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants