{"record":{"id":"7704121834ec6db0","repo":"quarkusio/quarkus","slug":"unable-to-determine-if-bean-classname-is-avai","errorCode":null,"errorMessage":"Unable to determine if bean '${className}' is available","messagePattern":"Unable to determine if bean '(.+?)' is available","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java","lineNumber":378,"sourceCode":"                    }\n\n                    // fail event rather than end it, so it's handled by abort handlers (see #addFailureHandler method)\n                    event.put(QuarkusHttpUser.AUTH_FAILURE_HANDLER, new FailingDefaultAuthFailureHandler());\n                }\n                event.next();\n            }\n        };\n    }\n\n    public Supplier<Boolean> beanUnavailable(String className) {\n        return new Supplier<>() {\n            @Override\n            public Boolean get() {\n                try {\n                    return !Arc.container().select(Class.forName(className, false, Thread.currentThread()\n                            .getContextClassLoader())).isResolvable();\n                } catch (ClassNotFoundException e) {\n                    throw new RuntimeException(\"Unable to determine if bean '\" + className + \"' is available\", e);\n                }\n            }\n        };\n    }\n\n    private List<RouteDescription> fromClassMappers(String applicationPath,\n            List<RequestMapper.RequestPath<RestInitialHandler.InitialMatch>> classMappers) {\n        Map<String, RouteDescription> descriptions = new HashMap<>();\n        RuntimeResourceVisitor.visitRuntimeResources(applicationPath, classMappers, new RuntimeResourceVisitor() {\n\n            private RouteDescription description;\n\n            @Override\n            public void visitRuntimeResource(String httpMethod, String fullPath, RuntimeResource runtimeResource) {\n                ServerMediaType serverMediaType = runtimeResource.getProduces();\n                List<MediaType> produces = Collections.emptyList();\n                if (serverMediaType != null) {\n                    if ((serverMediaType.getSortedOriginalMediaTypes() != null)","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java#L360-L396","documentation":"At runtime, a conditional-security (deny-unannotated / default check) supplier tries to reflectively load the bean class to ask Arc whether the bean is resolvable. If Class.forName cannot load the class name recorded at build time, it cannot decide availability and wraps the ClassNotFoundException in a RuntimeException.","triggerScenarios":"quarkus.security.jaxrs.deny-unannotated-endpoints / default-roles-allowed is enabled and a recorded resource class name cannot be loaded by the thread context classloader at runtime — typically because the class was removed/renamed after build, or a class in a non-visible module/classloader was indexed.","commonSituations":"Hot reload / stale build artifacts referencing removed classes; classloader isolation between the app and platform layers; running with an outdated application build after refactoring package names.","solutions":["Rebuild the application cleanly (./mvnw clean install) so recorded class names match the code","Fix the package/name refactor so the resource class exists at the recorded name","Ensure the class is in a module visible to the application classloader, not an optional/unloaded layer","If using dev mode, restart dev mode to refresh the runtime configuration suppliers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify the class is loadable before enabling deny-unannotated endpoints\ntry {\n    Class.forName(resourceClassName, false, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    // resource class not on runtime classpath — rebuild the app\n}","typeGuard":null,"tryCatchPattern":"try {\n    boolean resolvable = availabilitySupplier.get();\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof ClassNotFoundException) {\n        // stale build: trigger clean rebuild / restart dev mode\n    } else throw e;\n}","preventionTips":["Clean rebuild after renaming or removing resource classes","Keep quarkus.security.jaxrs.deny-unannotated-endpoints config consistent with existing classes","Avoid classloader isolation mismatches between app modules"],"tags":["quarkus","resteasy-reactive","cdi","classnotfound","security"],"backgroundTag":"classnotfound-during-deployment","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}