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

Getting error when running unit test #22

Closed
tarinidash opened this Issue Feb 7, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@tarinidash

tarinidash commented Feb 7, 2017

I tried to run below test in my environment and get error. The test keeps on running for sometime then finally gives up.

https://github.com/charithe/kafka-junit/blob/master/src/test/java/com/github/charithe/kafka/KafkaJunitClassRuleTest.java.

Error:>>
Exception in thread "Thread-0" java.lang.NoSuchFieldError: configFileStr
at org.apache.curator.test.QuorumConfigBuilder$1.(QuorumConfigBuilder.java:135)
at org.apache.curator.test.QuorumConfigBuilder.buildConfig(QuorumConfigBuilder.java:130)
at org.apache.curator.test.TestingZooKeeperServer$1.run(TestingZooKeeperServer.java:149)
at java.lang.Thread.run(Thread.java:745)

<< Hangs here for sometime and then quits with below error>>

java.lang.IllegalStateException: Timed out waiting for watch removal

at org.apache.curator.test.TestingZooKeeperMain.blockUntilStarted(TestingZooKeeperMain.java:153)
at org.apache.curator.test.TestingZooKeeperServer.start(TestingZooKeeperServer.java:159)
at org.apache.curator.test.TestingServer.<init>(TestingServer.java:117)
at org.apache.curator.test.TestingServer.<init>(TestingServer.java:100)
at org.apache.curator.test.TestingServer.<init>(TestingServer.java:52)
at com.github.charithe.kafka.EphemeralKafkaBroker.startBroker(EphemeralKafkaBroker.java:124)
at com.github.charithe.kafka.EphemeralKafkaBroker.start(EphemeralKafkaBroker.java:114)
at com.github.charithe.kafka.KafkaJunitRule.before(KafkaJunitRule.java:41)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Reference: >>

Below are the dependency I use.

    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>0.10.0.1</version>
    </dependency>
    <dependency>
        <groupId>com.github.charithe</groupId>
        <artifactId>kafka-junit</artifactId>
        <version>3.0.1</version>
        <scope>test</scope>
    </dependency>
@charithe

This comment has been minimized.

Show comment
Hide comment
@charithe

charithe Feb 7, 2017

Owner

It looks like a Zookeeper version clash. Are you trying to build this repo or have you just copied the unit test to your own project?

Owner

charithe commented Feb 7, 2017

It looks like a Zookeeper version clash. Are you trying to build this repo or have you just copied the unit test to your own project?

@tarinidash

This comment has been minimized.

Show comment
Hide comment
@tarinidash

tarinidash Feb 8, 2017

excluded zookeeper from org.apache.kafka:kafka_2.11:0.10.0.1 and its fixed the issue. Thanks a lot.

PS: I just copied the unit test and wanted to test as my current unit test were failing.

tarinidash commented Feb 8, 2017

excluded zookeeper from org.apache.kafka:kafka_2.11:0.10.0.1 and its fixed the issue. Thanks a lot.

PS: I just copied the unit test and wanted to test as my current unit test were failing.

@tarinidash

This comment has been minimized.

Show comment
Hide comment
@tarinidash

tarinidash Feb 8, 2017

removing extra zookeeper dependency solved the issue.

tarinidash commented Feb 8, 2017

removing extra zookeeper dependency solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment