I am using GraphQL on a Java project and it was working on a server. When I changed to another server, it stopped working and it is throwing the following exception:
java.lang.NoSuchMethodError: graphql.execution.ExecutionStrategy.(Lgraphql/execution/DataFetcherExceptionHandler;)V at graphql.execution.AbstractAsyncExecutionStrategy.(AbstractAsyncExecutionStrategy.java:19) at graphql.execution.AsyncExecutionStrategy.(AsyncExecutionStrategy.java:23) at graphql.GraphQL$Builder.(GraphQL.java:199) at graphql.GraphQL.newGraphQL(GraphQL.java:166)
I am using exactly the same Java version (1.8.0_181), the same graphql-java dependency version (7.0) and the same project version.
Am I missing something? Anyone with the same problem?
Thanks in advance,
Solution
After analyzing the dependencies of each one of my project dependencies, I noticed graphql-java-annotations was importing version 3.0 of graphql-java library. graphql-java library is one of my project dependencies as mentioned before (was using version 7.0).
As consequence, two different versions of graphql-java where being referenced and were conflicting with each other.
To solve this issue, I removed graphql-java dependency and I started using only the version imported on graphql-java-annotations.