Springboot 3.2.1(使用 Jetty)和 graphql-spqr-spring-boot-starter 1.0.0 出现错误

问题描述 投票:0回答:1

刚刚将 Spring Boot 升级到版本 3.2.1(使用 Jetty)并开始出现以下错误。知道如何解决这个问题吗?或者 graphql-spqr-spring-boot-starter:1.0.0 只兼容旧版本的 spring boot?

2024-01-04T17:31:09,780 WARN  qtp666678445-176 org.eclipse.jetty.ee10.servlet.ServletChannel - /graphql
jakarta.servlet.ServletException: Request processing failed: java.lang.IllegalStateException: Cannot resolve parameter names for constructor public io.leangen.graphql.spqr.spring.web.dto.GraphQLRequest(java.lang.String,java.lang.String,java.lang.String,java.util.Map)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1022) ~[spring-webmvc-6.1.2.jar:6.1.2]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.1.2.jar:6.1.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547) ~[jakarta.servlet-api-6.0.0.jar:6.0.0]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.1.2.jar:6.1.2]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar:6.0.0]
    at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:195) ~[jetty-ee10-websocket-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109) ~[spring-web-6.1.2.jar:6.1.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.2.jar:6.1.2]
    at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.1.2.jar:6.1.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.2.jar:6.1.2]
    at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547) ~[jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:797) [jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:428) [jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464) [jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:571) [jetty-security-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:703) [jetty-ee10-servlet-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:761) [jetty-server-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.server.Server.handle(Server.java:179) [jetty-server-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:594) [jetty-server-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:424) [jetty-server-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322) [jetty-io-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99) [jetty-io-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) [jetty-io-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:971) [jetty-util-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1201) [jetty-util-12.0.5.jar:12.0.5]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1156) [jetty-util-12.0.5.jar:12.0.5]
    at java.base/java.lang.Thread.run(Thread.java:833) [?:?]

更新1

好的,经过进一步调查,当我使用compilerArgs -parameters重新编译graphql-spqr-spring-boot-starter项目后,问题得到解决。

通过在 maven-compiler-plugin 部分下将以下内容添加到文件中进行测试https://github.com/leangen/graphql-spqr-spring-boot-starter/blob/master/pom.xml

<compilerArgs>
       <arg>-parameters</arg>
</compilerArgs>

是否可以进行小修复/发布?还是逃避内省?

请参阅下面的链接,了解有关 Spring 6 和参数名称保留问题/解决方案的更多详细信息。 https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x

graphql-spqr graphql-spqr-spring-boot-starter
1个回答
0
投票

最新版本的 GraphQL SPQR Spring Boot 启动器 (v1.0.1) 修复了此问题。
顺便说一句,下一个版本将是 v2.0.0,并将基于 Spring GraphQL,并且不会有任何自定义 HTTP/WebSocket 级别代码。

© www.soinside.com 2019 - 2024. All rights reserved.