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
- Fix the spelling / package of the class name in the template's parameter declaration
- Verify the class is part of the application or an indexed dependency (classes in src/main/java are indexed automatically)
- Use the fully-qualified name, since only java.lang simple names are auto-resolved
- 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
- Use fully-qualified class names in {@...} declarations unless the class is in java.lang
- Run the build (which validates templates) before shipping template changes
- After renaming/removing classes, grep templates for the old names
- Ensure referenced types come from indexed application/dependency classes
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
- No suitable template variant found
- Unsupported primitive:
- #cache cannot be used without the 'quarkus-cache' extension
- Template source not available
- Not a formattable date/time object:
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b2141f5cf6840931.
Report an issue: GitHub.