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

quarkus 3.9.1 federation with interfaces is broken #2068

Open
robp94 opened this issue Mar 28, 2024 · 7 comments
Open

quarkus 3.9.1 federation with interfaces is broken #2068

robp94 opened this issue Mar 28, 2024 · 7 comments

Comments

@robp94
Copy link
Contributor

robp94 commented Mar 28, 2024

If an interface has a key annotation, quarkus fails to start. This worked fine with quarkus 3.8.3

Reproducer https://github.com/robp94/code-with-quarkus-federation-error

2024-03-28 15:44:32,782 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ExceptionInInitializerError
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
	at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
	at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 3 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
	... 16 more
Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class graphql.language.StringValue (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; graphql.language.StringValue is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @6e2c9341)
	at com.apollographql.federation.graphqljava.SchemaTransformer.lambda$retrieveFieldSets$15(SchemaTransformer.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Collections$2.tryAdvance(Collections.java:5073)
	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:5081)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at com.apollographql.federation.graphqljava.SchemaTransformer.retrieveFieldSets(SchemaTransformer.java:199)
	at com.apollographql.federation.graphqljava.SchemaTransformer.lambda$getFederatedEntities$6(SchemaTransformer.java:153)
	at graphql.com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
	at com.apollographql.federation.graphqljava.SchemaTransformer.lambda$getFederatedEntities$7(SchemaTransformer.java:149)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at com.apollographql.federation.graphqljava.SchemaTransformer.getFederatedEntities(SchemaTransformer.java:146)
	at com.apollographql.federation.graphqljava.SchemaTransformer.build(SchemaTransformer.java:89)
	at io.smallrye.graphql.bootstrap.Bootstrap.generateGraphQLSchema(Bootstrap.java:221)
	at io.smallrye.graphql.bootstrap.Bootstrap.bootstrap(Bootstrap.java:128)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:52)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:42)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:32)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:27)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer_ClientProxy.initialize(Unknown Source)
	at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLRecorder.createExecutionService(SmallRyeGraphQLRecorder.java:36)
	at io.quarkus.deployment.steps.SmallRyeGraphQLProcessor$buildExecutionService1691419614.deploy_2(Unknown Source)
	at io.quarkus.deployment.steps.SmallRyeGraphQLProcessor$buildExecutionService1691419614.deploy(Unknown Source)
	... 17 more
@robp94
Copy link
Contributor Author

robp94 commented Apr 5, 2024

@jmartisk had you a look at the issue? Do you have an idea how to fix this?

@jmartisk
Copy link
Member

jmartisk commented Apr 5, 2024

Sorry not yet, too busy :/
I'll try to have a look asap, but meanwhile, maybe @RoKKim has an idea - from quickly looking at the code, I suspect it may be related to 7d8d987 and how we map the fields argument to a FieldSet

@robp94
Copy link
Contributor Author

robp94 commented Apr 18, 2024

@jmartisk any updates?

@jmartisk
Copy link
Member

So far I came up with this jmartisk@254b0aa to unwrap the value of fields to a String instead of a map, but I'm getting

Caused by: graphql.schema.validation.InvalidSchemaException: invalid schema:
Invalid argument 'fields' for applied directive of name 'key'

which I'm not quite sure why. Hoping @RoKKim could help...

@RoKKim
Copy link
Contributor

RoKKim commented Apr 18, 2024

I will check it out as soon as I find the time. Sorry for not replying earlier.

@robp94
Copy link
Contributor Author

robp94 commented May 14, 2024

Any updates?

@robp94
Copy link
Contributor Author

robp94 commented May 24, 2024

@jmartisk @RoKKim could you take a look at #2116 this at least seems to fix my reproducer. But I have not tested if it really works, just quarkus is starting again.

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

3 participants