diff --git a/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java b/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java index d8b1e60e26edc..55a1168d3d995 100644 --- a/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java +++ b/extensions/resteasy-classic/resteasy-common/deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java @@ -56,6 +56,7 @@ import io.quarkus.deployment.builditem.StaticInitConfigBuilderBuildItem; import io.quarkus.deployment.builditem.SystemPropertyBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.util.ServiceUtil; import io.quarkus.resteasy.common.runtime.ResteasyInjectorFactoryRecorder; @@ -343,6 +344,16 @@ void registerNativeImageResources(BuildProducer servic .allProvidersFromClassPath(org.jboss.resteasy.spi.config.ConfigurationFactory.class.getName())); } + /** + * ResourceCleaner contains java.lang.ref.Cleaner references which need to get + * runtime initialized. + */ + @BuildStep + public RuntimeInitializedClassBuildItem runtimeInitResourceCleaner() { + return new RuntimeInitializedClassBuildItem( + "org.jboss.resteasy.spi.ResourceCleaner"); + } + private void registerJsonContextResolver( DotName jsonImplementation, DotName jsonContextResolver,