quarkusio/quarkus · error · DefinitionException

Decorated interface ${decoratedType} not found in the index

Error message

Decorated interface ${decoratedType} not found in the index

What it means

When computing which methods of a decorated interface a decorator must implement, ArC looks up the decorated type in the bean archive index. If the interface class is not in the indexed application classes, this DefinitionException is thrown — the decorator references a type the container cannot see.

Source

Thrown at independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanInfo.java:885

                addDecoratedMethods(decoratedMethods, interfaceInfo, originalClassInfo, boundDecorators, skipPredicate);
            }
        }
    }

    private record DecoratedMethodCandidate(MethodInfo method, DecorationInfo decoration) {
    }

    record InterceptedMethodCandidate(MethodInfo method, Set<AnnotationInstance> bindings) {
    }

    private List<DecoratorMethod> findMatchingDecorators(MethodInfo method, List<DecoratorInfo> decorators) {
        List<DecoratorMethod> matching = new ArrayList<>(decorators.size());
        IndexView index = beanDeployment.getBeanArchiveIndex();
        outermost: for (DecoratorInfo decorator : decorators) {
            for (Type decoratedType : decorator.getDecoratedTypes()) {
                ClassInfo decoratedInterface = index.getClassByName(decoratedType.name());
                if (decoratedInterface == null) {
                    throw new DefinitionException("Decorated interface " + decoratedType.name() + " not found in the index");
                }

                Map<String, Type> resolvedTypeParameters = Types.resolveDecoratedTypeParams(decoratedInterface, decorator);

                // it's enough to look at methods declared directly on the decorated interface,
                // because its superinterfaces are present in the set of decorated types
                for (MethodInfo decoratedMethod : decoratedInterface.methods()) {
                    if (!method.name().equals(decoratedMethod.name())) {
                        continue;
                    }
                    if (method.parametersCount() != decoratedMethod.parametersCount()) {
                        continue;
                    }

                    // Match the resolved parameter types
                    boolean matches = true;
                    List<Type> decoratedMethodParams = Types.getResolvedParameters(decoratedInterface, resolvedTypeParameters,
                            decoratedMethod, index);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the JAR containing the decorated interface is indexed by Jandex (add a META-INF/jandex.idx or the quarkus-index-dependency config).
  2. Add the interface to a module/classpath location that gets indexed by the application build.
  3. Verify @Decorates targets the correct interface name/package.
  4. Regenerate the index if the class was recently added (clean build).

Example fix

// before (unindexed dependency)
<dependency>
  <groupId>com.acme</groupId><artifactId>api</artifactId>
</dependency>
// after (enable Jandex indexing)
<dependency>
  <groupId>com.acme</groupId><artifactId>api</artifactId>
</dependency>
<!-- or in quarkus-maven-plugin config -->
<dependencies>
  <dependency>com.acme:api</dependency>
</dependencies>
Defensive patterns

Strategy: validation

Validate before calling

// Verify the decorated interface is on the application classpath and indexed
Class<?> decorated = Class.forName("com.acme.Api");
if (decorated.getPackage().getName().startsWith("java.")) {
    throw new IllegalStateException("Decorated type cannot come from an unindexed/platform package");
}

Prevention

When it happens

Trigger: A @Decorator declares @Decorates a type that is not part of the indexed bean archive (external/unindexed JAR, generated class, or wrong type referenced), so index.getClassByName returns null in BeanInfo decorator validation.

Common situations: Decorator references an interface from a library JAR not indexed by Jandex; the decorated type lives in an unindexed dependency; typo pointing at a class rather than the intended interface.

Related errors


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