Error regarding "configDirectory" when running examples/run.sh
hclbaur opened this issue · comments
When running the run.sh (or run.cmd) script I get the error below.
I believe the problem has to do with the annotation:
[ksml\ksml-runner\src\main\java\io\axual\ksml\runner\config\KSMLConfig.java]
@JsonProperty("configDirectory")
private String configurationDirectory;
Shouldn't the annotation be on the getter method rather than on the field?
2022-05-27T09:37:28,447Z [system] [main] ERROR io.axual.ksml.runner.KSMLRunner - An exception occurred while reading the configuration
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "configDirectory" (class io.axual.ksml.runner.config.KSMLConfig), not marked as ignorable (3 known properties: "definitions", "application.server", "workingDirectory"])
at [Source: (File); line: 3, column: 25] (through reference chain: io.axual.ksml.runner.config.KSMLRunnerConfig["ksml"]->io.axual.ksml.runner.config.KSMLConfig["configDirectory"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:855)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1212)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1604)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1582)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:299)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4482)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3299)
at io.axual.ksml.runner.KSMLRunner.main(KSMLRunner.java:51)
Hi Harold, which runner image (version) are you running? If you build the image using Dockerfile-build-runner
as per the README, do you still get this error? This property was added recently as part of #38 , tested on OSX and Linux (I don't have any Windows machines...)
I was using the runner from dockerhub, which is quite old. I will try building an image myself, I'm sure that will fix it.
I'm confident that it will, let me know how you fare so I can close this issue (or you can close it if you want).
The image on Dockerhub is indeed outdated, I'm working on #17 which would automate building a new image.
I am not having any luck getting it to build. It fails somewhere during the maven test due a windows versus unix issue in the asserts that do not expect a carriage return. I'll tinker with it some more.
Building it is not going to work on Windows due to carriage return versus line feed issues.
Example of an error I get:
#13 196.1 [ERROR] Tests run: 10, Failures: 5, Errors: 0, Skipped: 0, Time elapsed: 56.805 s <<< FAILURE! - in io.axual.ksml.KSMLTopologyGeneratorBasicTest
#13 196.1 [ERROR] parseAndCheckOuput{int}[1] Time elapsed: 55.643 s <<< FAILURE!
#13 196.1 java.lang.AssertionError:
#13 196.1
#13 196.1 Expected: is "Topologies:\r\n Sub-topology: 0\r\n Source: sensor_stream (topics: [ksml_sensordata_avro])\r\n --> for_each_001\r\n Processor: for_each_001 (stores: [])\r\n --> none\r\n <-- sensor_stream\r\n\r\n"
#13 196.1 but: was "Topologies:\n Sub-topology: 0\n Source: sensor_stream (topics: [ksml_sensordata_avro])\n --> for_each_001\n Processor: for_each_001 (stores: [])\n --> none\n <-- sensor_stream\n\n"
#13 196.1 at io.axual.ksml.KSMLTopologyGeneratorBasicTest.parseAndCheckOuput(KSMLTopologyGeneratorBasicTest.java:76)
Maybe I should wait until you complete the automated build :)
Assuming you have docker commandline tools, did you try the multistage buildfile? That would build the code inside a Docker image and should be platform independent:
docker build -t axual/ksml -f Dockerfile-build-runner .
This will build a plain Kafka KSML runner, if you want one with Axual client:
docker build -t axual/ksml -f Dockerfile-build-runner . --build-arg runner=ksml-runner-axual
Let me know if this works for you. And BTW thanks for pointing this out, as I said I don't have access to a Windows machine.
By the way, if you use the Maven build, adding -DskipTests
is kind of not nice but should also help you get past the error ;)
I was indeed using the multistage buildfile without Axual client. After adding the -DskipTests flag to the mvn in Dockerfile-build-runner it was building correctly, and I am able to run the demo (examples/run.cmd).
I suppose you can close this issue as the original problem was caused by using an outdated ksml runner. Getting the mvn build to run correctly on Windows would be a nice improvement though.
Thanks for the help in getting the demo to work!
Ho Harold, you're welcome! I'm actually surprised / disappointed that the multistage build does fail on Windows like that, I was kind of expecting that using Docker in this way would prevent it. I'll create a separate issue to track this, maybe I can fix the test somehow to work around this.
Hi Harold, closed this issue and opened #45 for the failing multistage build on Windows.
I have a favor to ask: there's a branch with a fix: https://github.com/axual/ksml/tree/45-fix-test - would you be able to switch to that branch, and verify that with this the build runs on Windows? Many thanks in advance (and have a nice weekend)!
Yes, I can build it without errors from that branch, fix works.