but on running I am getting follwing exception when line 1 is getting executed:
Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V
at io.grpc.Metadata$Key.validateName(Metadata.java:742)
at io.grpc.Metadata$Key.(Metadata.java:750)
at io.grpc.Metadata$Key.(Metadata.java:668)
at io.grpc.Metadata$AsciiKey.(Metadata.java:959)
at io.grpc.Metadata$AsciiKey.(Metadata.java:954)
at io.grpc.Metadata$Key.of(Metadata.java:705)
at io.grpc.Metadata$Key.of(Metadata.java:701)
at io.temporal.serviceclient.WorkflowServiceStubsImpl.(WorkflowServiceStubsImpl.java:56)
at io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:51)
at io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:41)
at io.temporal.serviceclient.WorkflowServiceStubs.newInstance(WorkflowServiceStubs.java:36)
I haven’t seen that issue personally, but very similar was reported here, (specific reply here), and ended up being a guava version issue. Worth looking into it on your end as well imo.
Hi @tihomir,
Thanks for the help as it looks like guava issue only. That issue is resolved by using the guava version 20. But now am getting ClassNotFoundException on the following execution :
DefaultDataConverter.getDefaultInstance();
Also to get rid of guava issue I had to move to older version of temporal.
Hi @tihomir,
I am getting the following error:
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
… 26 more
Something is going wrong JacksonJsonPayloadConverter class
What framework are you adding the Temporal depends to? Maybe SpringBoot?
I would start with looking at your whole project dependencies
If you are using Maven
mvn dependency:tree
or with gradle
gradle -q dependencies
and see what all libraries bring in guava libs and what versions there are. Then you probably need to add excludes to your depends to make sure only 1 version is loaded.
Hi @tihomir , I am using on both spring boot and drop wizard framework. I did the same and got the guava thing sorted out. But guava has removed a lot of things going forward in their journey and yet I managed to somehow balance between temporal guava dependency and drop wizard guava dependency. But after resolving that I got the error(The jacksonPayloadConverter issue) which is again some dependency issue only and now it seems due to complete backward incompatible guava and all it would not be possible to incorporate temporal within the time line I have been provided for this project.
The ‘Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase’ exception has nothing to do with guava. Also, Temporal support any recent guava versions. Temporal works fine with guava 10, while the current version is 31.
New release of java-sdk will not enforce guava version and will ask just for a range the following way: ‘[10.0,)!!31.0.1-jre’
To the ‘com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase’.
I’m relatively sure that what’s going here is that you have
non-synchronized versions of com.fasterxml.jackson.datatype:jackson-datatype-jsr310 and com.fasterxml.jackson.core:jackson-databind in your classpath. com.fasterxml.jackson.datatype:jackson-datatype-jsr310 uses ToStringSerializerBase which is added in com.fasterxml.jackson.core:jackson-databind:2.10.
My best guess is that you likely excluded com.fasterxml.jackson.datatype:jackson-databind from temporal-sdk in favor of some older version that you supply or that it coming from another project?
If so, you have to exclude com.fasterxml.jackson.datatype:jackson-datatype-jsr310 and supply your classpath with a correct older version. When excluding transitive dependencies in favor of older versions, you should be excluding all tightly coupled modules and suppling older versions of them.
Generally, @tihomir advice is correct, the right way is to print dependency tree, grep for com.fasterxml.jackson and make sure that the versions are not mixed. Jackson library is quite sensitive with mismatching of its modules. Especially jackson-databind.
If you print the dependency tree, you most likely will find com.fasterxml.jackson.core:jackson-databind of an earlier version than 2.10 coming from somewhere.
We will rework our Jackson reference to using jackson-bom as it’s the best that we can do and it’s kinda state of the art approach like it’s described here: Automatically align Dependencies with Platforms and Gradle Module Metadata
So users will be able to use platforms to align versions across dependencies. At least, it will be fully supported from our, Temporal, side.
Hi @spikhalskiy, I agree that this is not guava issue as with the help of @tihomir I got guava issue sorted out but what I am pointing here is balancing one thing is making other dependency unbalanced. Also the thing with guava is that in there newer versions they have removed some of the functions so I am unable to try those versions as my application is using those functions. But as you and @tihomir pointed out I am trying with dependency tree.
@Pritam_Kumar2 thanks for bringing this up! As @spikhalskiy mentioned, we will make improvements regarding Jackson and depends integration with different frameworks.
Let us know what we can help with now to help unblock you. Could you share your SpringBoot and Dropwizard versions, so we can try to reproduce the issue and might be able to help with the investigation.