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

graphql-java version not compatible with graphql-spring-boot-starter #589

Closed
idegroot opened this issue Mar 16, 2021 · 2 comments
Closed
Assignees
Milestone

Comments

@idegroot
Copy link

I upgraded my implementation project to the latest graphql-spring-boot-starter version but this caused a bean creation error when used with the graphql generated code because of conflicting versions of graphql-java code generator. Would it be possible to upgrade the version of graphql-java in graphql-java-codegen to 16.2?

code-generation project:

<dependency>
    <groupId>io.github.kobylynskyi</groupId>
    <artifactId>graphql-java-codegen</artifactId>
    <version>4.1.0</version>
</dependency>

implementation project:

<dependency>
   <groupId>com.graphql-java-kickstart</groupId>
   <artifactId>graphql-spring-boot-starter</artifactId>
   <version>11.0.0</version>
</dependency>

error:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchemaProvider' defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchemaProvider' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphQLSchema' defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; nested exception is java.lang.NoClassDefFoundError: graphql/collect/ImmutableKit
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphQLSchema' defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; nested exception is java.lang.NoClassDefFoundError: graphql/collect/ImmutableKit

The error was solved when I explicitly managed the dependency of graphql-java to 16.2.

<dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java</artifactId>
    <version>16.2</version>
</dependency>
@idegroot idegroot changed the title graphql-java version not compatible with spring graphql-java version not compatible with graphql-spring-boot-starter Mar 16, 2021
@kobylynskyi kobylynskyi added this to the 5.0.0 milestone Mar 21, 2021
@kobylynskyi kobylynskyi self-assigned this Mar 21, 2021
kobylynskyi added a commit that referenced this issue Mar 25, 2021
@kobylynskyi
Copy link
Owner

kobylynskyi commented Apr 6, 2021

@idegroot
5.0.0 was released.
graphql-java and other libraries are now excluded from the classpath of graphql-java-codegen so please try upgrading graphql-java-codegen to 5.0.0.
Thanks.

@idegroot
Copy link
Author

idegroot commented Apr 7, 2021

This is an even better solution. Thank you for addressing the issue. I can confirm that 5.0.0 solves our problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants