liyuan-rey

liyuan-rey

Member Since 6 years ago

Experience Points
6
follower
Lessons Completed
0
follow
Lessons Completed
79
stars
Best Reply Awards
35
repos

22 contributions in the last year

Pinned
⚡ The articles and codes recoded in technical research.
⚡ Use Github Pages to publish AriaNg (an Aria2 front-end).
Activity
Nov
24
1 week ago
Activity icon
fork

liyuan-rey forked gogs/gogs

⚡ Gogs is a painless self-hosted Git service
liyuan-rey MIT License Updated
fork time in 1 week ago
Nov
6
4 weeks ago
push

liyuan-rey push liyuan-rey/northwind-spring-graphql

liyuan-rey
liyuan-rey

update: 补充 lombok 构造函数注解,修改测试类名以更符合规范,补充 schema

liyuan-rey
liyuan-rey

add: 尝试了多种 JPA 推断查询的实现效果, test.graphql 里是测试 query

commit sha: beea8a57a8800b5fb43dc0ab632751ee1150e941

push time in 4 weeks ago
Activity icon
issue

liyuan-rey issue spring-projects/spring-graphql

liyuan-rey
liyuan-rey

Got `NoClassDefFoundError: FluentQuery` issue with version M3

Hi guys,

I'm using Spring GraphQL M3 and Spring Boot 2.5.6 together.

When fire graphql query at runtime, I‘ve got error in service console like this:

2021-11-06 10:38:38.923 ERROR 6340 --- [nio-9000-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/FluentQuery$FetchableFluentQuery] with root cause

java.lang.ClassNotFoundException: org.springframework.data.repository.query.FluentQuery$FetchableFluentQuery
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
        at org.springframework.graphql.data.querydsl.QuerydslDataFetcher$SingleEntityFetcher.get(QuerydslDataFetcher.java:438) ~[spring-graphql-1.0.0-M3.jar:na]
        at org.springframework.graphql.execution.ContextDataFetcherDecorator.get(ContextDataFetcherDecorator.java:67) ~[spring-graphql-1.0.0-M3.jar:na]
        at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:279) ~[graphql-java-17.3.jar:na]
        at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:210) ~[graphql-java-17.3.jar:na]
        at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:60) ~[graphql-java-17.3.jar:na]
        at graphql.execution.Execution.executeOperation(Execution.java:159) ~[graphql-java-17.3.jar:na]
        at graphql.execution.Execution.execute(Execution.java:105) ~[graphql-java-17.3.jar:na]
        at graphql.GraphQL.execute(GraphQL.java:613) ~[graphql-java-17.3.jar:na]
        at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:538) ~[graphql-java-17.3.jar:na]
        at graphql.GraphQL.executeAsync(GraphQL.java:502) ~[graphql-java-17.3.jar:na]
        at org.springframework.graphql.execution.ExecutionGraphQlService.lambda$execute$0(ExecutionGraphQlService.java:67) ~[spring-graphql-1.0.0-M3.jar:na]
        at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47) ~[reactor-core-3.4.11.jar:3.4.11]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4399) ~[reactor-core-3.4.11.jar:3.4.11]
        at reactor.core.publisher.Mono.subscribeWith(Mono.java:4514) ~[reactor-core-3.4.11.jar:3.4.11]
        at reactor.core.publisher.Mono.toFuture(Mono.java:4919) ~[reactor-core-3.4.11.jar:3.4.11]
        at org.springframework.core.ReactiveAdapterRegistry$ReactorRegistrar.lambda$registerAdapters$5(ReactiveAdapterRegistry.java:265) ~[spring-core-5.3.12.jar:5.3.12]
        at org.springframework.core.ReactiveAdapter.fromPublisher(ReactiveAdapter.java:121) ~[spring-core-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.function.DefaultAsyncServerResponse.create(DefaultAsyncServerResponse.java:188) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.function.ServerResponse.async(ServerResponse.java:239) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.graphql.web.webmvc.GraphQlHttpHandler.handleRequest(GraphQlHttpHandler.java:85) ~[spring-graphql-1.0.0-M3.jar:na]
        at org.springframework.web.servlet.function.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:106) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) ~[tomcat-embed-core-9.0.54.jar:4.0.FR]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.12.jar:5.3.12]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.54.jar:4.0.FR]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.12.jar:5.3.12]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.12.jar:5.3.12]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.12.jar:5.3.12]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.12.jar:5.3.12]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.12.jar:5.3.12]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.12.jar:5.3.12]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1722) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.54.jar:9.0.54]
        at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

After some research, I realize the issue caused by that, spring-graphql-1.0.0-M3 depending on spring-data-jpa-2.6.0-RC1.jar(with FluentQuery implemented), but graphql-spring-boot-starter-1.0.0-M3.jar still stick with spring-data-jpa-2.5.6.jar.

Fixed this issue by adding extra dependences in build.gradle:

dependencies {
	// Spring GraphQL Boot starter
+	implementation 'org.springframework.data:spring-data-commons:2.6.0-RC1'
+	implementation 'org.springframework.data:spring-data-jpa:2.6.0-RC1'
	implementation 'org.springframework.experimental:graphql-spring-boot-starter:1.0.0-M3'

I will provide demo if you need. Hope this issue could be fixed in near future.

Nov
5
1 month ago
push

liyuan-rey push liyuan-rey/northwind-spring-graphql

liyuan-rey
liyuan-rey

add: 实现 GraphQL 数据服务基本功能

commit sha: 7cd4cf9b97f3e10154783da21d4e84ad0b74bc72

push time in 1 month ago
Activity icon
issue

liyuan-rey issue comment spring-projects/spring-graphql

liyuan-rey
liyuan-rey

Can't find the class org.springframework.graphql.boot.WebGraphQlHandlerAutoConfiguration

When running a Spring Boot app using the 1.0.0-M3 version of the org.springframework.experiment:graphql-spring-boot-starter, it complains:

java.lang.IllegalStateException: Unable to read meta-data for class org.springframework.graphql.boot.WebGraphQlHandlerAutoConfiguration

When I unzip the graphql-spring-boot-starter jar file and look inside, I cannot find this class, although I can find other classes of the same package. Is that the reason why it dies? I can't seem to find where the AutoConfiguration is picking up the reference to this class.

liyuan-rey
liyuan-rey

The description of the problem is not very clear, but I guess it is similar to the problem I encountered when using the M3 version. My solution is to add Spring Boot 2.6.0-RC1 related dependencies, which may be useful to you.

dependencies {
+    implementation 'org.springframework.data:spring-data-commons:2.6.0-RC1'
+    implementation 'org.springframework.data:spring-data-jpa:2.6.0-RC1'
    implementation 'org.springframework.experimental:graphql-spring-boot-starter:1.0.0-M3'
}
Nov
3
1 month ago
push

liyuan-rey push liyuan-rey/northwind-spring-graphql

liyuan-rey
liyuan-rey

add: 设置 H2 数据库相关配置

liyuan-rey
liyuan-rey

add: 添加 entity 和 repository 并实现数据库初始化和单元测试

commit sha: 3e29ecbcad5bec9c820247fe1f7c9c86c1461214

push time in 1 month ago
started
started time in 1 month ago
started
started time in 1 month ago
Oct
30
1 month ago
push

liyuan-rey push liyuan-rey/northwind-spring-graphql

liyuan-rey
liyuan-rey

add: 增加 spring boot cli 创建的 data service 工程

liyuan-rey
liyuan-rey

add: 为 dataservice 添加 README.md 文件

liyuan-rey
liyuan-rey

update: 调整应用配置为 YAML 格式,调整 lombok 引入方式采用插件形式

commit sha: 5dbfe5a6ad8001776bdbb482e1a47d69cc869058

push time in 1 month ago
Oct
28
1 month ago
Activity icon
fork

liyuan-rey forked introproventures/graphql-jpa-query

⚡ Generate GraphQL Query Api for your JPA Entity Models
liyuan-rey Apache License 2.0 Updated
fork time in 1 month ago
Activity icon
fork

liyuan-rey forked igdianov/GraphQL-SpringBoot

⚡ GraphQL's implementation in java with spring-boot, spring-jpa, jetty and mongo
liyuan-rey MIT License Updated
fork time in 1 month ago
Oct
18
1 month ago
started
started time in 1 month ago