Hi, For the java client API <https://github.com/ty...
# community-help
g
Hi, For the java client API https://github.com/typesense/typesense-java , anyone ever faced the not found exception method in typesense dependency when try to run the war file in tomcat web server, the issue says “java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType()Lcom/fasterxml/jackson/databind/JavaType”, but in the local all works. For the full stacktrace:
k
Seems like a different version of the dependency is being picked up when you create the WAR file. Try running
mvn tree
to get a tree of dependencies and iron out version incompatibility (probably Jackson).
g
This is how my dependency tree looks like, I have looked up on the typesense dependency but there is no some kind ‘typesense’ word shows in the tree, about the jackson
this is how I compile my local typensense dependency, is it the right way?
k
Typesense is also on Maven Central now so you can directly use the dependency instead of using JAR.
Also, in the dep tree, I see multiple
jackson-databind
dependencies of various versions, so that is causing API incompatibility.
g
let me check first, thanks for your feedback @Kishore Nallan
Hi just want to share how I solve my problem, the issue that I faced called jar hell, the causes of my problem bcs the different of jackson version that typesense use and my apps dependency use, so how I solve it, I use gradle shadow plugin to force rename dependency name one of two version jackson plugin. So you can have 2 version jackson at once in a project. I know it’s not the best practice implementation but It’s the fastest way to fix this problem temporary. For the gradle shadow plugin, refers to this link: https://medium.com/@ruijiang/using-gradle-shadow-plugin-to-resolve-java-version-conflict-183bd6ea4228
k
Thanks for sharing!
👍 1