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

ksql-test-runner fails loading hamcrest and other testing jars #3387

Closed
spena opened this issue Sep 19, 2019 · 3 comments · Fixed by #4272 or #4425
Closed

ksql-test-runner fails loading hamcrest and other testing jars #3387

spena opened this issue Sep 19, 2019 · 3 comments · Fixed by #4272 or #4425
Assignees
Labels
blocker bug ksql-test-runner Issues relating to ksql-test-runner introduced in 5.3
Milestone

Comments

@spena
Copy link
Member

spena commented Sep 19, 2019

When executing the ksql-test-runner from a packaged confluent installation, the following error is thrown:

$ ./ksql-test-runner -s /tmp/statements.sql -i /tmp/input.json -o /tmp/output.json

...
Caused by: java.lang.ClassNotFoundException: org.hamcrest.Matcher
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

The reason is because the following jars are not packaged in KSQL:

ksql-functional-tests/hamcrest-all-1.3.jar
ksql-functional-tests/junit-4.12.jar

In 5.3.1, the kafka-clients-5.3.1-css is not found either:

ksql-functional-tests/kafka-clients-5.3.2-ccs-20190919.011153-4-test.jar

Workaround
The workaround is to copy the required jars into the confluent/ksql classpath. For instance, being /opt/confluent/confluent-5.3.1/share/java/ksql the classpath:

$ cd /opt/confluent/confluent-5.3.1/share/java/ksql
$ wget https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar
$ wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar

This bug is found since the 5.3.x branch.

@spena spena added the bug label Sep 19, 2019
@big-andy-coates big-andy-coates added ksql-test-runner Issues relating to ksql-test-runner introduced in 5.3 blocker labels Oct 11, 2019
@big-andy-coates big-andy-coates added this to the 5.4 milestone Oct 11, 2019
@big-andy-coates
Copy link
Contributor

I've marked this as a blocker for 5.4, which strictly speaking it isn't as its already broken in 5.3. But we should really get the testing tool into a usable state for this release.

@holgerbrandl
Copy link
Contributor

Is there any workaround until the fix? E.g using some pre-release automatically built containerized version of the ksql-test-runner?

@big-andy-coates big-andy-coates modified the milestones: 5.4, 0.7.0 Dec 2, 2019
@holgerbrandl
Copy link
Contributor

Since 0.7 seems still quite far away, I still wonder about a workaround? E.g. by patching the class-path or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug ksql-test-runner Issues relating to ksql-test-runner introduced in 5.3
Projects
None yet
3 participants