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

Unable to initialize REST resources in tests #120

Closed
valdar opened this issue Apr 6, 2020 · 2 comments
Closed

Unable to initialize REST resources in tests #120

valdar opened this issue Apr 6, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@valdar
Copy link
Member

valdar commented Apr 6, 2020

Tests logs contains:

org.apache.kafka.connect.errors.ConnectException: Unable to initialize REST resources
	at org.apache.kafka.connect.runtime.rest.RestServer.initializeResources(RestServer.java:301) ~[connect-runtime-2.4.1.jar:?]
	at org.apache.kafka.connect.runtime.Connect.start(Connect.java:54) ~[connect-runtime-2.4.1.jar:?]
	at org.apache.camel.kafkaconnector.services.kafkaconnect.KafkaConnectRunner.run(KafkaConnectRunner.java:198) ~[test-classes/:?]
	at org.apache.camel.kafkaconnector.services.kafkaconnect.KafkaConnectRunnerService.lambda$start$0(KafkaConnectRunnerService.java:107) ~[test-classes/:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.NullPointerException
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:802) ~[jetty-server-9.4.20.v20190813.jar:9.4.20.v20190813]
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276) ~[jetty-servlet-9.4.20.v20190813.jar:9.4.20.v20190813]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-util-9.4.20.v20190813.jar:9.4.20.v20190813]
	at org.apache.kafka.connect.runtime.rest.RestServer.initializeResources(RestServer.java:299) ~[connect-runtime-2.4.1.jar:?]```
This is most probably due to how kafka connect environment is initialized mimiking what kafka connect standalone dose and missing the REST server init part.
@valdar valdar added the bug Something isn't working label Apr 6, 2020
@valdar
Copy link
Member Author

valdar commented Apr 6, 2020

Talking to @orpiske this is somehow related to #118 in the sense that using closer to real embedded Kafka connect embedded environment might solve both. An enhancement was already logged to do so in #105

The idea is to see if using org.apache.kafka.connect.util.clusters.EmbeddedConnectCluster solves both issues and then evaluate from there how to integrate it in the broader integration test facilities that we have in place.

orpiske added a commit to orpiske/camel-kafka-connector that referenced this issue Apr 10, 2020
orpiske added a commit to orpiske/camel-kafka-connector that referenced this issue Apr 10, 2020
@valdar
Copy link
Member Author

valdar commented Apr 22, 2020

fixed with #138

@valdar valdar closed this as completed Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant