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 queries returning Collection.class are broken in native mode #15571

Closed
jmartisk opened this issue Mar 9, 2021 · 1 comment · Fixed by #15576
Closed

GraphQL queries returning Collection.class are broken in native mode #15571

jmartisk opened this issue Mar 9, 2021 · 1 comment · Fixed by #15576
Assignees
Labels
Milestone

Comments

@jmartisk
Copy link
Contributor

jmartisk commented Mar 9, 2021

Any time I attempt to perform a GraphQL query returning a Collection<Something> (it works correctly with List<Something>) against Quarkus in native mode, I get this

2021-03-09 10:43:52,601 ERROR [io.sma.graphql] (vert.x-worker-thread-0) SRGQL012000: Data Fetching Error: java.lang.RuntimeException: Can not load class [java.util.Collection]
	at io.quarkus.smallrye.graphql.runtime.spi.QuarkusClassloadingService.loadClass(QuarkusClassloadingService.java:47)
	at io.smallrye.graphql.execution.datafetcher.CollectionCreator.newCollection(CollectionCreator.java:27)
	at io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper.recursiveTransformCollection(AbstractHelper.java:203)
	at io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper.recursiveTransform(AbstractHelper.java:72)
	at io.smallrye.graphql.execution.datafetcher.helper.FieldHelper.transformResponse(FieldHelper.java:32)
	at io.smallrye.graphql.execution.datafetcher.DefaultDataFetcher.invokeAndTransform(DefaultDataFetcher.java:39)
	at io.smallrye.graphql.execution.datafetcher.AbstractDataFetcher.get(AbstractDataFetcher.java:62)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:270)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:203)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:60)
	at graphql.execution.Execution.executeOperation(Execution.java:165)
	at graphql.execution.Execution.execute(Execution.java:104)
	at graphql.GraphQL.execute(GraphQL.java:557)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:482)
	at graphql.GraphQL.executeAsync(GraphQL.java:446)
	at graphql.GraphQL.execute(GraphQL.java:377)
	at io.smallrye.graphql.execution.ExecutionService.execute(ExecutionService.java:130)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doRequest(SmallRyeGraphQLExecutionHandler.java:176)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doRequest(SmallRyeGraphQLExecutionHandler.java:169)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handlePost(SmallRyeGraphQLExecutionHandler.java:112)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doHandle(SmallRyeGraphQLExecutionHandler.java:93)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handle(SmallRyeGraphQLExecutionHandler.java:64)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handle(SmallRyeGraphQLExecutionHandler.java:37)
	at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:834)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: java.util.Collection
	at java.security.AccessController.doPrivileged(AccessController.java:122)
	at io.quarkus.smallrye.graphql.runtime.spi.QuarkusClassloadingService.loadClass(QuarkusClassloadingService.java:41)
	... 30 more
Caused by: java.lang.ClassNotFoundException: java.util.Collection
	at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:60)
	at java.lang.Class.forName(DynamicHub.java:1260)
	at io.smallrye.graphql.spi.ClassloadingService.loadClass(ClassloadingService.java:66)
	at io.quarkus.smallrye.graphql.runtime.spi.QuarkusClassloadingService.lambda$loadClass$0(QuarkusClassloadingService.java:43)
	at java.security.AccessController.doPrivileged(AccessController.java:120)
	... 31 more
@jmartisk jmartisk added the kind/bug Something isn't working label Mar 9, 2021
@jmartisk jmartisk self-assigned this Mar 9, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 9, 2021

/cc @phillip-kruger

@jmartisk jmartisk changed the title GraphQL querying broken in native mode GraphQL queries returning collections are broken in native mode Mar 9, 2021
@jmartisk jmartisk changed the title GraphQL queries returning collections are broken in native mode GraphQL queries returning Collection.class are broken in native mode Mar 9, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 9, 2021
@gsmet gsmet modified the milestones: 1.13 - master, 1.12.2.Final Mar 10, 2021
This was referenced Mar 12, 2021
This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants