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

Resteasy Reactive - Using BeanParam with custom paramconverter throws NPE #21664

Closed
Postremus opened this issue Nov 24, 2021 · 3 comments · Fixed by #21689
Closed

Resteasy Reactive - Using BeanParam with custom paramconverter throws NPE #21664

Postremus opened this issue Nov 24, 2021 · 3 comments · Fixed by #21689
Labels
area/rest env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@Postremus
Copy link
Member

Describe the bug

I get a nullpointerexception, when I try to use a LocalDateTime as a QueryParam on a class used as BeanParam in resteasy-reactive.
LocalDateTime gets converted using my own ParamConverter + ParamConverterProvider.
The same paramconverts work fine on resteasy-classic.

When I use LocalDateTime QueryParam of the resource (without the beanparam indirection), the app starts fine.

Expected behavior

No response

Actual behavior

2021-11-24 08:28:47,809 WARN  [io.qua.hib.orm.dep.HibernateOrmProcessor] (build-4) Hibernate ORM is disabled because no JPA entities were found
2021-11-24 08:28:49,128 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2021-11-24 08:28:49,274 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2021-11-24 08:28:49,535 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.steps.ClassTransformingBuildStep#handleClassTransformation threw an exception: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter"
is null
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:830)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at java.base/java.lang.Thread.run(Thread.java:833)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.handleClassTransformation(ClassTransformingBuildStep.java:231)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821)
        ... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.generateConverterInitMethod(ClassInjectorTransformer.java:222)
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.visitEnd(ClassInjectorTransformer.java:194)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:748)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.transformClass(ClassTransformingBuildStep.java:317)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:204)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:191)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:418)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:276)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:67)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:91)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:446)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:65)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:149)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:105)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:145)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.steps.ClassTransformingBuildStep#handleClassTransformation threw an exception: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter"
is null
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:830)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at java.base/java.lang.Thread.run(Thread.java:833)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.handleClassTransformation(ClassTransformingBuildStep.java:231)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821)
        ... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.generateConverterInitMethod(ClassInjectorTransformer.java:222)
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.visitEnd(ClassInjectorTransformer.java:194)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:748)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.transformClass(ClassTransformingBuildStep.java:317)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:204)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:191)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

        at io.quarkus.builder.Execution.run(Execution.java:116)
        at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:161)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:416)
        ... 9 more
Caused by: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at io.quarkus.deployment.ExtensionLoader$2.exxtensionLoader.java:830)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
        at java.base/java.lang.Thread.run(Thread.java:833)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.handleClassTransformation(ClassTransformingBuildStep.java:231)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821)
        ... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.jboss.resteasy.reactive.server.core.parameters.converters.ParameterConverterSupplier.getClassName()" because "converter" is null
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.generateConverterInitMethod(ClassInjectorTransformer.java:222)
        at io.quarkus.resteasy.reactive.server.deployment.ClassInjectorTransformer$ClassInjectorVisitor.visitEnd(ClassInjectorTransformer.java:194)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:748)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep.transformClass(ClassTransformingBuildStep.java:317)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:204)
        at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:191)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

Download the reproducer:
rr-paramconverter.zip

mvn quarkus:dev

Does not start, the exception from above is printed

In ReactiveGreetingResource, replace the beanparam with @RestQuery LocalDateTime datetime

The app starts fine

Output of uname -a or ver

MSYS_NT-10.0-19043 NANB7NLNVP2 3.1.7-340.x86_64 2021-03-26 22:17 UTC x86_64 Msys

Output of java -version

MSYS_NT-10.0-19043 NANB7NLNVP2 3.1.7-340.x86_64 2021-03-26 22:17 UTC x86_64 Msys PS C:\workspaces\aviator\rr-paramconverter> java --version openjdk 17 2021-09-14 OpenJDK Runtime Environment Temurin-17+35 (build 17+35) OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.4.2.Final, 2.5.0.CR1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: C:\eclipse\tools\apache-maven Java version: 17, vendor: Eclipse Adoptium, runtime: C:\eclipse\tools\java\17 Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@Postremus Postremus added the kind/bug Something isn't working label Nov 24, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 24, 2021

/cc @FroMage, @geoand, @stuartwdouglas

@quarkus-bot quarkus-bot bot added area/rest env/windows Impacts Windows machines labels Nov 24, 2021
@geoand
Copy link
Contributor

geoand commented Nov 24, 2021

@Sgitario wanna take a look at this one?

@Sgitario
Copy link
Contributor

@Sgitario wanna take a look at this one?

Looking

@quarkus-bot quarkus-bot bot added this to the 2.6 - main milestone Nov 25, 2021
@gsmet gsmet modified the milestones: 2.6 - main, 2.5.1.Final Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants