quarkusio/quarkus · error · io.quarkus.qute.TemplateException

Class [<rawClassName>] used in the parameter declaration in

Error message

Class [<rawClassName>] used in the parameter declaration in template [<templatePath>] on line <line> was not found in the application index. Make sure it is spelled correctly.

What it means

Qute type-safe template parameter declarations (e.g. {@org.acme.Item item}) reference classes that must exist in the Jandex application index. When the raw class name cannot be resolved (even after trying the java.lang package prefix), TypeInfos throws this TemplateException during template expression validation.

Source

Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/TypeInfos.java:141

        return null;
    }

    static boolean isArray(String typeInfo) {
        return typeInfo == null ? false : typeInfo.indexOf(ARRAY_DIM) > 0;
    }

    private static ClassInfo getClassInfo(String val, IndexView index, Function<String, String> templateIdToPathFun,
            Origin expressionOrigin) {
        DotName rawClassName = rawClassName(val);
        ClassInfo clazz = index.getClassByName(rawClassName);
        if (clazz == null) {
            if (!rawClassName.toString().contains(".")) {
                // Try the java.lang prefix for a name without package
                rawClassName = DotName.createSimple(Types.JAVA_LANG_PREFIX + rawClassName.toString());
                clazz = index.getClassByName(rawClassName);
            }
            if (clazz == null) {
                throw new TemplateException(
                        "Class [" + rawClassName + "] used in the parameter declaration in template ["
                                + templateIdToPathFun.apply(expressionOrigin.getTemplateGeneratedId()) + "] on line "
                                + expressionOrigin.getLine()
                                + " was not found in the application index. Make sure it is spelled correctly.");
            }
        }
        return clazz;
    }

    private static PrimitiveType decodePrimitive(String val) {
        switch (val) {
            case "byte":
                return PrimitiveType.BYTE;
            case "char":
                return PrimitiveType.CHAR;
            case "double":
                return PrimitiveType.DOUBLE;
            case "float":

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the spelling / package of the class name in the template's parameter declaration
  2. Verify the class is part of the application or an indexed dependency (classes in src/main/java are indexed automatically)
  3. Use the fully-qualified name, since only java.lang simple names are auto-resolved
  4. Rebuild the application so Jandex re-indexes the class

Example fix

// before (template)
{@org.acme.Itemm item}
// after (template)
{@org.acme.Item item}
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check in a build step or test
String className = "org.acme.Item";
boolean indexed = index.getClassByName(DotName.createSimple(className)) != null;
if (!indexed) throw new IllegalStateException("Template parameter class not indexed: " + className);

Try / catch

try {
    // build-time template validation happens automatically
} catch (TemplateException e) {
    if (e.getMessage().contains("was not found in the application index")) {
        log.error("Fix the class name in the template parameter declaration");
        throw e;
    }
}

Prevention

When it happens

Trigger: A template declares {@com.example.Missing param} where com.example.Missing is not in the application index — class doesn't exist, is misspelled, lives in a non-indexed jar, or was excluded from indexing.

Common situations: Typo in a fully-qualified class name in a {@...} declaration; referencing a class from a dependency not indexed by Quarkus; class removed after a refactor while templates still reference it; using a simple name for a class not in java.lang.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/b2141f5cf6840931. Report an issue: GitHub.