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 and Bean validation: runtime error on native build #13858

Closed
morphy76 opened this issue Dec 12, 2020 · 3 comments
Closed

GraphQL and Bean validation: runtime error on native build #13858

morphy76 opened this issue Dec 12, 2020 · 3 comments
Labels
area/graphql area/smallrye triage/duplicate This issue or pull request already exists

Comments

@morphy76
Copy link

Environment:

Quarkus 1.10.3.Final

java -version
openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-suse-lp152.2.6.2-x8664)
OpenJDK 64-Bit Server VM (build 11.0.9+11-suse-lp152.2.6.2-x8664, mixed mode)

$GRAALVM_HOME/bin/java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)

Use case

Mongo entity with panache and bean validation.
JaxRS endpoint to post entities into mongodb (using reactive client)
GraphQL endpoint to query the mongo collection

JVM runner

All good

Native binary

GraphQL endpoint fails with the following message:

ERROR [io.sma.graphql] (vert.x-worker-thread-0) SRGQL012000: Data Fetching Error: javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:291)
        at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:103)
        at io.smallrye.graphql.cdi.validation.ValidationService.beforeInvoke(ValidationService.java:28)
        at io.smallrye.graphql.execution.event.EventEmitter.fireBeforeMethodInvoke(EventEmitter.java:91)
        at io.smallrye.graphql.execution.datafetcher.helper.ReflectionHelper.invoke(ReflectionHelper.java:80)
        at io.smallrye.graphql.spi.datafetcher.DefaultWrapperHandlerService.invokeAndTransform(DefaultWrapperHandlerService.java:42)
        at io.smallrye.graphql.spi.datafetcher.AbstractWrapperHandlerService.getData(AbstractWrapperHandlerService.java:59)
        at io.smallrye.graphql.execution.datafetcher.PlugableDataFetcher.get(PlugableDataFetcher.java:34)
        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:122)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doRequest(SmallRyeGraphQLExecutionHandler.java:169)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doRequest(SmallRyeGraphQLExecutionHandler.java:162)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handlePost(SmallRyeGraphQLExecutionHandler.java:105)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.doHandle(SmallRyeGraphQLExecutionHandler.java:86)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handle(SmallRyeGraphQLExecutionHandler.java:63)
        at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLExecutionHandler.handle(SmallRyeGraphQLExecutionHandler.java:36)
        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:517)
        at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193
@ghost
Copy link

ghost commented Dec 12, 2020

/cc @jmartisk, @phillip-kruger

@phillip-kruger
Copy link
Member

Hi @morphy76 , thanks for this issue. This looks like a duplicate of #13777, that has been fixed and merges into master.

@gsmet gsmet added the triage/duplicate This issue or pull request already exists label Dec 14, 2020
@gsmet
Copy link
Member

gsmet commented Dec 14, 2020

I can confirm it's the exact same issue.

@gsmet gsmet closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql area/smallrye triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants