{"record":{"id":"4dfe88de37b9fa90","repo":"quarkusio/quarkus","slug":"the-class-classname-cannot-be-found-during-de","errorCode":null,"errorMessage":"The class (${className}) cannot be found during deployment.","messagePattern":"The class \\((.+?)\\) cannot be found during deployment\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java","lineNumber":260,"sourceCode":"    protected boolean hasValidatorCapability() {\n        return capabilities.isPresent(Capability.HIBERNATE_VALIDATOR);\n    }\n\n    protected boolean isNotReactivePanache() {\n        return !capabilities.isPresent(Capability.HIBERNATE_REACTIVE);\n    }\n\n    private static Enum schemaTypeArray() {\n        Class<?> schemaTypeClass = toClass(SCHEMA_TYPE_CLASS_NAME);\n        return Enum.valueOf((Class<Enum>) schemaTypeClass, SCHEMA_TYPE_ARRAY);\n    }\n\n    private static Class<?> toClass(String className) {\n        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n        try {\n            return classLoader.loadClass(className);\n        } catch (ClassNotFoundException e) {\n            throw new IllegalStateException(\"The class (\" + className + \") cannot be found during deployment.\", e);\n        }\n    }\n}\n","sourceCodeStart":242,"sourceCodeEnd":264,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java#L242-L264","documentation":"StandardMethodImplementor builds OpenAPI/Gizmo annotations at deployment time and needs to load classes by name from the deployment classloader. If Thread.currentThread().getContextClassLoader().loadClass(className) cannot resolve the class, the build aborts with this IllegalStateException. It indicates a type referenced by the generated resource (e.g. an OpenAPI schema type, a java type like BigDecimal, or an entity/ID type) is not visible during augmentation.","triggerScenarios":"Deployment time while generating a resource method's OpenAPI response annotation or resolving a schema type: toClass() is called with a class name (from addOpenApiResponseAnnotation or schemaTypeClass) that is not on the deployment classpath — e.g. a custom type referenced by the entity, a wrong fully-qualified name in a schema annotation, or a required extension jar absent.","commonSituations":"Entity or ID fields use types from a library not on the compile/deploy classpath; typos in @Schema(implementation=...) strings; missing dependency (e.g. java-money, custom DTO module) so the OpenAPI schema type cannot be loaded; split-package/classloading surprises in custom deployment code.","solutions":["Add the missing dependency containing the named class to the application so it is present at deployment time.","Check the class name in the message for typos or wrong packages in schema/OpenAPI annotations.","Ensure the type is in a normal application (runtime) artifact, not an excluded/optional one.","If you changed this extension code, verify you load via the proper Quarkus deployment classloader (e.g. ClassLoader.getSystemClassLoader or the app-classloader BuildItem) rather than the TCCL."],"exampleFix":"// before: type not on classpath\n@Schema(implementation = com.acme.NotIncludedDto.class)\n// after: add the dependency, or reference a resolvable type\n<dependency>com.acme:acme-dto</dependency>\n@Schema(implementation = com.acme.IncludedDto.class)","handlingStrategy":"validation","validationCode":"// before relying on a type in schema/OpenAPI metadata\ntry {\n    Class.forName(\"com.acme.SomeDto\", false, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Dependency containing com.acme.SomeDto is missing from the deployment classpath\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add every type referenced by entity fields and schema annotations to the build classpath.","Avoid string-based class names in schema metadata; use .class references so compile errors surface early.","Check for typos in fully-qualified names in the error message.","Keep DTOs/entities in normal runtime artifacts, not deployment-only modules."],"tags":["quarkus","build-time","classloader","rest-data-panache","openapi"],"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"}