Title: Cannot invoke "javax.validation.Constraint.validatedBy()" in reactive context · Issue #70 · graphql-java/graphql-java-extended-validation · GitHub
Open Graph Title: Cannot invoke "javax.validation.Constraint.validatedBy()" in reactive context · Issue #70 · graphql-java/graphql-java-extended-validation
X Title: Cannot invoke "javax.validation.Constraint.validatedBy()" in reactive context · Issue #70 · graphql-java/graphql-java-extended-validation
Description: In our current reactive project (Spring Webflux 2.7.0), we get the following stack trace when activating extended validation. The following schema directive @Size(min : Int = 0, max : Int = 128, message : String = "graphql.validation.Siz...
Open Graph Description: In our current reactive project (Spring Webflux 2.7.0), we get the following stack trace when activating extended validation. The following schema directive @Size(min : Int = 0, max : Int = 128, me...
X Description: In our current reactive project (Spring Webflux 2.7.0), we get the following stack trace when activating extended validation. The following schema directive @Size(min : Int = 0, max : Int = 128, me...
Opengraph URL: https://github.com/graphql-java/graphql-java-extended-validation/issues/70
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot invoke \"javax.validation.Constraint.validatedBy()\" in reactive context","articleBody":"In our current reactive project (Spring Webflux 2.7.0), we get the following stack trace when activating extended validation. The following schema \r\n\r\n```graphql\r\ndirective @Size(min : Int = 0, max : Int = 128, message : String = \"graphql.validation.Size.message\")\r\non ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION\r\n\r\ntype Mutation {\r\n test(name: String @Size(min: 5, max: 128)): String\r\n}\r\n```\r\n\r\nwill produce the following stack trace when being invoked:\r\n\r\n```\r\njava.lang.NullPointerException: Cannot invoke \"javax.validation.Constraint.validatedBy()\" because the return value of \"java.lang.Class.getAnnotation(java.lang.Class)\" is null\r\n```\r\n\r\n\u003cdetails>\r\n\u003csummary>Extend full stack trace\u003c/summary>\r\n\u003cpre>\r\n\tat org.hibernate.validator.internal.metadata.core.ConstraintHelper.getDefaultValidatorDescriptors(ConstraintHelper.java:1146) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat org.hibernate.validator.internal.metadata.core.ConstraintHelper.lambda$getAllValidatorDescriptors$0(ConstraintHelper.java:872) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]\r\n\tat org.hibernate.validator.internal.metadata.core.ConstraintHelper$ValidatorDescriptorMap.computeIfAbsent(ConstraintHelper.java:1185) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat org.hibernate.validator.internal.metadata.core.ConstraintHelper$ValidatorDescriptorMap.access$100(ConstraintHelper.java:1175) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat org.hibernate.validator.internal.metadata.core.ConstraintHelper.getAllValidatorDescriptors(ConstraintHelper.java:872) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.\u003cinit>(ConstraintDescriptorImpl.java:189) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.\u003cinit>(ConstraintDescriptorImpl.java:240) ~[hibernate-validator-6.2.3.Final.jar:6.2.3.Final]\r\n\tat graphql.validation.interpolation.ResourceBundleMessageInterpolator.buildHibernateContext(ResourceBundleMessageInterpolator.java:152) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.interpolation.ResourceBundleMessageInterpolator.interpolateMessageImpl(ResourceBundleMessageInterpolator.java:109) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.interpolation.ResourceBundleMessageInterpolator.interpolate(ResourceBundleMessageInterpolator.java:93) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.AbstractDirectiveConstraint.mkError(AbstractDirectiveConstraint.java:323) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.standard.AbstractSizeConstraint.runConstraint(AbstractSizeConstraint.java:28) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.GraphQLListElementValidator.runConstraintOnListElements(GraphQLListElementValidator.java:39) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.AbstractDirectiveConstraint.runConstrainOnPossibleListElements(AbstractDirectiveConstraint.java:164) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.AbstractDirectiveConstraint.runConstraintOnDirectives(AbstractDirectiveConstraint.java:154) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.AbstractDirectiveConstraint.runValidationImpl(AbstractDirectiveConstraint.java:135) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.constraints.AbstractDirectiveConstraint.runValidation(AbstractDirectiveConstraint.java:131) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.rules.TargetedValidationRules.runValidationImpl(TargetedValidationRules.java:131) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.rules.TargetedValidationRules.runValidationRules(TargetedValidationRules.java:121) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat graphql.validation.schemawiring.FieldValidatorDataFetcher.get(FieldValidatorDataFetcher.java:47) ~[graphql-java-extended-validation-18.1.jar:na]\r\n\tat org.springframework.boot.actuate.metrics.graphql.GraphQlMetricsInstrumentation.lambda$instrumentDataFetcher$1(GraphQlMetricsInstrumentation.java:98) ~[spring-boot-actuator-2.7.0.jar:2.7.0]\r\n\tat graphql.execution.instrumentation.dataloader.DataLoaderDispatcherInstrumentation.lambda$instrumentDataFetcher$0(DataLoaderDispatcherInstrumentation.java:87) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:279) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:210) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:182) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.AsyncSerialExecutionStrategy.lambda$execute$1(AsyncSerialExecutionStrategy.java:43) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.Async.eachSequentiallyImpl(Async.java:80) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.Async.eachSequentially(Async.java:69) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.AsyncSerialExecutionStrategy.execute(AsyncSerialExecutionStrategy.java:38) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.Execution.executeOperation(Execution.java:160) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.execution.Execution.execute(Execution.java:106) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.GraphQL.execute(GraphQL.java:641) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:561) ~[graphql-java-18.1.jar:na]\r\n\tat java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[na:na]\r\n\tat java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309) ~[na:na]\r\n\tat graphql.GraphQL.parseValidateAndExecute(GraphQL.java:556) ~[graphql-java-18.1.jar:na]\r\n\tat graphql.GraphQL.executeAsync(GraphQL.java:524) ~[graphql-java-18.1.jar:na]\r\n\tat org.springframework.graphql.execution.DefaultExecutionGraphQlService.lambda$execute$2(DefaultExecutionGraphQlService.java:81) ~[spring-graphql-1.0.0.jar:1.0.0]\r\n\tat reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:299) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:159) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) ~[reactor-core-3.4.18.jar:3.4.18]\r\n\tat reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400) ~[reactor-netty-core-1.0.19.jar:1.0.19]\r\n\tat reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419) ~[reactor-netty-core-1.0.19.jar:1.0.19]\r\n\tat reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:600) ~[reactor-netty-http-1.0.19.jar:1.0.19]\r\n\tat reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93) ~[reactor-netty-core-1.0.19.jar:1.0.19]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:266) ~[reactor-netty-http-1.0.19.jar:1.0.19]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299) ~[netty-codec-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]\r\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]\r\n\tat java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]\r\n\u003c/pre>\r\n\u003c/details>\r\n\r\nHowever if we remove the directive from the `test` mutation schema, the responsible controller method will be invoke, but the return value will be overwritten with \"MonoJust\":\r\n\r\n```graphql\r\n{\r\n\t\"data\": {\r\n\t\t\"test\": \"MonoJust\"\r\n\t}\r\n}\r\n```\r\n\r\nThe controller implementation is pretty simple:\r\n\r\n```kotlin\r\n@MutationMapping(\"test\")\r\nfun test(@Argument name: String): Mono\u003cString> {\r\n return name.uppercase().toMono()\r\n}\r\n```\r\n\r\nDo you support operations with Reactive DataFetchers? \r\n","author":{"url":"https://github.com/sullrich84","@type":"Person","name":"sullrich84"},"datePublished":"2022-07-01T13:43:29Z","url":"https://github.com/graphql-java/graphql-java-extended-validation/issues/70"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c99e5343-ff89-42d6-57d7-0a87cdc1471b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C65E:38EE04:162E73:1D9163:6B01866E |
| html-safe-nonce | f92ab24bc14193e9d055ae5afc4e6a09ffeacd7b6a7cff6143921680a8e2032a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjVFOjM4RUUwNDoxNjJFNzM6MUQ5MTYzOjZCMDE4NjZFIiwidmlzaXRvcl9pZCI6Ijc3Mjc3NzAwMzk5ODE1NDA5NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 44a3ddd06fb8a92b84113b088c4e888f7324b8521d413531b9da1a344236a4a8 |
| hovercard-subject-tag | issue:1291430846 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-java/graphql-java-extended-validation/70/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d59ce8cc5e760d0ae9772edac2e76690e559bf5f133a80d8923276e888535583/graphql-java/graphql-java-extended-validation/issues/70 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d59ce8cc5e760d0ae9772edac2e76690e559bf5f133a80d8923276e888535583/graphql-java/graphql-java-extended-validation/issues/70 |
| og:image:alt | In our current reactive project (Spring Webflux 2.7.0), we get the following stack trace when activating extended validation. The following schema directive @Size(min : Int = 0, max : Int = 128, me... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sullrich84 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/graphql-java-extended-validation git https://github.com/graphql-java/graphql-java-extended-validation.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 205507809 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java-extended-validation |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205507809 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java-extended-validation |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width