{"record":{"id":"6722842616aafbf3","repo":"quarkusio/quarkus","slug":"unknown-class-token","errorCode":null,"errorMessage":"Unknown class: ${token}","messagePattern":"Unknown class: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/types/TypeParser.java","lineNumber":165,"sourceCode":"            case \"short\" -> short.class;\n            case \"int\" -> int.class;\n            case \"long\" -> long.class;\n            case \"float\" -> float.class;\n            case \"double\" -> double.class;\n            case \"char\" -> char.class;\n            default -> throw unexpected(token);\n        };\n    }\n\n    private boolean isClassType(String token) {\n        return !token.isEmpty() && Character.isJavaIdentifierStart(token.charAt(0));\n    }\n\n    private Type parseClassType(String token) {\n        try {\n            return Class.forName(token, true, Thread.currentThread().getContextClassLoader());\n        } catch (ClassNotFoundException e) {\n            throw new IllegalArgumentException(\"Unknown class: \" + token, e);\n        }\n    }\n\n    // ---\n\n    private void expect(String expected) {\n        String token = nextToken();\n        if (!expected.equals(token)) {\n            throw unexpected(token);\n        }\n    }\n\n    private IllegalArgumentException unexpected(String token) {\n        if (token.isEmpty()) {\n            throw new IllegalArgumentException(\"Unexpected end of input: \" + str);\n        }\n        return new IllegalArgumentException(\"Unexpected token '\" + token + \"' at position \" + (pos - token.length())\n                + \": \" + str);","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/types/TypeParser.java#L147-L183","documentation":"TypeParser parses configuration type strings (e.g. in Dev UI / config class name references) into java.lang.reflect Types. parseClassType loads the token with Class.forName; if the class is not found on the thread context classloader, this IllegalArgumentException wrapping the ClassNotFoundException is thrown.","triggerScenarios":"In parseClassType (called from result and parseArrayType): a token representing a class or generic type argument (e.g. inside List<SomeType>) cannot be loaded via TCCL Class.forName.","commonSituations":"Typo in a fully qualified class name inside a generic type string; class removed/renamed after refactor while an old type string persisted (e.g. in stored config or Dev UI requests); class in a module not visible to the runtime classloader; missing dependency containing the type.","solutions":["Correct the fully qualified class name in the type string","Add the dependency/jar containing the class to the runtime classpath","Verify the class is not only available at deployment time — runtime modules need it at runtime too","Check for package renames in recent library upgrades and update the type string"],"exampleFix":"// before\nparse(\"java.util.List<com.acme.old.Dto>\")\n// after\nparse(\"java.util.List<com.acme.api.Dto>\")","handlingStrategy":"validation","validationCode":"void checkTypeToken(String token) throws ClassNotFoundException {\n    String cls = token.replaceAll(\"<.*>\", \"\").trim();\n    Class.forName(cls, false, Thread.currentThread().getContextClassLoader());\n}","typeGuard":null,"tryCatchPattern":"try {\n    type = TypeParser.parse(typeString);\n} catch (IllegalArgumentException e) {\n    if (e.getCause() instanceof ClassNotFoundException cnfe) {\n        // log cnfe.getMessage() and fix the class name/classpath\n    }\n    throw e;\n}","preventionTips":["Use fully qualified class names in type strings","Update stored/generated type strings after package renames","Ensure the referenced type's jar is on the runtime classpath, not only deployment","Inspect the wrapped ClassNotFoundException cause for the exact missing class"],"tags":["quarkus","classloading","type-parsing","config"],"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"}