Repository: quarkusio/quarkus
Issue: Resteasy Reactive - NoClassDefFoundError: io/quarkus/generated/java/lang/Long$quarkusrestparamConverter$

**Describe the bug**
I have a class "ListFilterImportData", which is used in all projects as BeanParam, in a common artefact. it looks something like this (getter/setter omitted for brevity):
```
    @QueryParam("language")
    String language;

    @QueryParam("page")
    @DefaultValue("1")
    Integer page;

    @QueryParam("sortAscending")
    @DefaultValue("false")
    Boolean sortAscending;

    @QueryParam("anotherValue")
    @DefaultValue("1")
    Long anotherValue;

    @QueryParam("anotherValue2")
    @DefaultValue("1")
    Short anotherValue2;
```

I now want to use this common artefact on a resource method like this:
```
@GET
public String hello(@BeanParam ListFilterImportData filterImportData)
```

This works without Problems in Resteasy Classic.

In Resteasy Reactive however, the ParamConverter for Long can not be found in dev mode, as indicated by the exception below. If I add this missing ParamConverter, another exception is throw but this time for Integer missing its ParamConverter.

**Expected behavior**
Classes defined in other artefacts should just work as BeanParams.

**Actual behavior**
I get this exception, indicating a missing ParamConverter for Long. I also get the same exception for String and Boolean.
```
Listening for transport dt_socket at address: 5005
2021-03-12 08:38:22,539 INFO  [org.jbo.threads] (main) JBoss Threads version 3.2.0.Final
2021-03-12 08:38:24,439 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start hot replacement endpoint to recover from previous Quarkus startup failure
2021-03-12 08:38:24,440 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:134)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:65)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
        at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
        ... 6 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:255)
        ... 15 more
Caused by: java.lang.NoClassDefFoundError: io/quarkus/generated/java/lang/Long$quarkusrestparamConverter$
        at org.acme.common.ListFilterImportData.__quarkus_init_converter__anotherValue(ListFilterImportData.java)
        at io.quarkus.rest.runtime.__QuarkusInit.init(__QuarkusInit.zig:31)
        at io.quarkus.resteasy.reactive.server.runtime.ResteasyReactiveRecorder.createDeployment(ResteasyReactiveRecorder.java:113)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupEndpoints-1591811826.deploy_1(ResteasyReactiveProcessor$setupEndpoints-1591811826.zig:3522)
        at io.quarkus.deployment.steps.ResteasyReactiveProcessor$setupEndpoints-1591811826.deploy(ResteasyReactiveProcessor$setupEndpoints-1591811826.zig:45)
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:224)
        ... 15 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.generated.java.lang.Long$quarkusrestparamConverter$
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:428)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:378)
        ... 21 more
```


**To Reproduce**


Steps to reproduce the behavior:
1.  Download the reproducer: 
[rr-missing-paramconverter.zip](https://github.com/quarkusio/quarkus/files/6128351/rr-missing-paramconverter.zip)
2. cd common, mvn clean install
3. cd ../web, mvn quarkus:dev
4. The exception from above happens


**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: 
 MSYS_NT-10.0 NANB7NLNVP2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msys
 - Quarkus version or git rev: 
1.12.2.Final
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): 
 Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\\eclipse\\tools\\apache-maven\\bin\\..
Java version: 11.0.7, vendor: Azul Systems, Inc., runtime: C:\\eclipse\\tools\\zulu11.39.15-ca-jdk11.0.7-win_x64
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"


Changed files:
extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java
extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java

diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java
index 2e02d9759b5..72479621899 100644
--- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java
+++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java
@@ -10,6 +10,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Predicate;
 
 import javax.ws.rs.core.MediaType;
 
@@ -53,6 +54,7 @@
     private final DefaultProducesHandler defaultProducesHandler;
 
     private final Map<String, String> multipartGeneratedPopulators = new HashMap<>();
+    private final Predicate<String> applicationClassPredicate;
 
     private static final Set<DotName> CONTEXT_TYPES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
             DotName.createSimple(HttpServerRequest.class.getName()),
@@ -66,6 +68,7 @@
         this.bytecodeTransformerBuildProducer = builder.bytecodeTransformerBuildProducer;
         this.reflectiveClassProducer = builder.reflectiveClassProducer;
         this.defaultProducesHandler = builder.defaultProducesHandler;
+        this.applicationClassPredicate = builder.applicationClassPredicate;
     }
 
     protected boolean isContextType(ClassType klass) {
@@ -166,7 +169,9 @@ protected ParameterConverterSupplier extractConverter(String elementType, IndexV
             }
             baseName = effectivePrefix + "$quarkusrestparamConverter$";
             try (ClassCreator classCreator = new ClassCreator(
-                    new GeneratedClassGizmoAdaptor(generatedClassBuildItemBuildProducer, true), baseName, null,
+                    new GeneratedClassGizmoAdaptor(generatedClassBuildItemBuildProducer,
+                            applicationClassPredicate.test(elementType)),
+                    baseName, null,
                     Object.class.getName(), ParameterConverter.class.getName())) {
                 MethodCreator mc = classCreator.getMethodCreator("convert", Object.class, Object.class);
                 if (stringCtor != null) {
@@ -245,6 +250,7 @@ public static final class Builder extends AbstractBuilder<Builder> {
         private BuildProducer<ReflectiveClassBuildItem> reflectiveClassProducer;
         private MethodCreator initConverters;
         private DefaultProducesHandler defaultProducesHandler = DefaultProducesHandler.Noop.INSTANCE;
+        public Predicate<String> applicationClassPredicate;
 
         @Override
         public QuarkusServerEndpointIndexer build() {
@@ -273,6 +279,11 @@ public Builder setReflectiveClassProducer(
             return this;
         }
 
+        public Builder setApplicationClassPredicate(Predicate<String> applicationClassPredicate) {
+            this.applicationClassPredicate = applicationClassPredicate;
+            return this;
+        }
+
         public Builder setInitConverters(MethodCreator initConverters) {
             this.initConverters = initConverters;
             return this;
diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java
index 307adbaee1a..738d8c310fd 100644
--- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java
+++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java
@@ -77,6 +77,7 @@
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.ApplicationClassPredicateBuildItem;
 import io.quarkus.deployment.builditem.BytecodeTransformerBuildItem;
 import io.quarkus.deployment.builditem.CapabilityBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
@@ -244,6 +245,7 @@ public void setupEndpoints(Capabilities capabilities, BeanArchiveIndexBuildItem
             ExceptionMappersBuildItem exceptionMappersBuildItem,
             ParamConverterProvidersBuildItem paramConverterProvidersBuildItem,
             ContextResolversBuildItem contextResolversBuildItem,
+            List<ApplicationClassPredicateBuildItem> applicationClassPredicateBuildItems,
             List<MethodScannerBuildItem> methodScanners, ResteasyReactiveServerConfig serverConfig)
             throws NoSuchMethodException {
 
@@ -367,7 +369,15 @@ private boolean hasAnnotation(MethodInfo method, short paramPosition, DotName an
                             return false;
                         }
                     })
-                    .setInitConverters(initConverters);
+                    .setInitConverters(initConverters)
+                    .setApplicationClassPredicate(s -> {
+                        for (ApplicationClassPredicateBuildItem i : applicationClassPredicateBuildItems) {
+                            if (i.test(s)) {
+                                return true;
+                            }
+                        }
+                        return false;
+                    });
 
             if (!serverDefaultProducesHandlers.isEmpty()) {
                 List<DefaultProducesHandler> handlers = new ArrayList<>(serverDefaultProducesHandlers.size());