spring-io / initializr

A quickstart generator for Spring projects
https://start.spring.io
Apache License 2.0
3.43k stars 1.73k forks source link

Spring boot Autoconfigure not wokring with java graphql version 22.x #1534

Closed cepoiubogdan-query-labs closed 3 months ago

cepoiubogdan-query-labs commented 3 months ago

Hello! We did a GraphQL java upgrade to the latest version, and this version i think it is not compatible with the latest version of Spring Boot 3.2.5 the issue I am having right now looks like this: An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration.annotatedControllerConfigurerDataFetcherExceptionResolver(GraphQlAutoConfiguration.java:168)

The following method did not exist:

'org.springframework.graphql.execution.DataFetcherExceptionResolver org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer.getExceptionResolver()'

The calling method's class, org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration, was loaded from the following location:

jar:file:/C:/myworkspace/repository/org/springframework/boot/spring-boot-autoconfigure/3.2.5/spring-boot-autoconfigure-3.2.5.jar!/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.class

The called method's class hierarchy was loaded from the following locations:

org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer: file:/C:/myworkspace/repository/org/springframework/graphql/spring-graphql/1.3.0/spring-graphql-1.3.0.jar
org.springframework.graphql.data.method.annotation.support.AnnotatedControllerDetectionSupport: file:/C:/myworkspace/repository/org/springframework/graphql/spring-graphql/1.3.0/spring-graphql-1.3.0.jar
mhalbritter commented 3 months ago

Hello! When generating a project on start.spring.io with GraphQL and Boot 3.2.5, you'll get Spring GraphQL 1.2.6, which works with Boot 3.2.5.

It looks like you have manually overriden the Spring GraphQL version to 1.3.0, which would explain that failure. Spring Boot 3.3.0 (which is released today) is tested against Spring GraphQL 1.3.0.

cepoiubogdan-query-labs commented 3 months ago

The error was already happening with version 1.2.6, and Springboot 3.2.5, that's why I tried upgrading Spring GraqphQL to 1.3.0

wilkinsona commented 3 months ago

I can't see why that would be the case as Spring Boot 3.2.5 was compiled against Spring GraphQL 1.2.6. I think the incompatibility is due to this change but that's only in Spring for GraphQL 1.3.

This problem doesn't really have anything to do with Spring Initializr, BTW. You may want to raise a Spring GraphQL issue about the binary incompatible change in 1.3.