quarkusio/quarkus · error · IllegalArgumentException
No implementation of interface ${interface} was found
Error message
No implementation of interface ${interface} was found What it means
Every custom fragment interface used by a Spring Data repository must have exactly one implementing class. This error is thrown when the Jandex index contains no class implementing the fragment interface, so Quarkus has nothing to wire the generated forwarding methods to.
Source
Thrown at extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/FragmentMethodsUtil.java:38
if (knownImplementors.size() > 1) {
DotName previouslyFound = null;
for (ClassInfo knownImplementor : knownImplementors) {
if (knownImplementor.name().toString().endsWith("Impl")) { // the default suffix that Spring Data JPA looks for is 'Impl'
if (previouslyFound != null) { // make sure we don't have multiple implementations suffixed with 'Impl'
throw new IllegalArgumentException(
"Interface " + customInterfaceToImplement
+ " must contain a single implementation whose name ends with 'Impl'. Multiple implementations were found: "
+ previouslyFound + "," + knownImplementor);
}
previouslyFound = knownImplementor.name();
}
}
return previouslyFound;
} else if (knownImplementors.size() == 1) {
return knownImplementors.iterator().next().name();
} else {
throw new IllegalArgumentException(
"No implementation of interface " + customInterfaceToImplement + " was found");
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Create a class implementing the fragment interface, named with the 'Impl' suffix (e.g. UserRepositoryCustomImpl) and annotate it @Component (or @Repository)
- Check the implementor's 'implements' clause actually names the fragment interface (typos, wrong package import)
- If the implementation lives in a dependency JAR, index that JAR (META-INF/jandex.idx or quarkus.index-dependency.*)
- Clean rebuild to refresh the index
Example fix
// before
public interface UserRepositoryCustom { List<User> findByCustomQuery(String q); }
// (no implementation)
// after
public class UserRepositoryCustomImpl implements UserRepositoryCustom {
@PersistenceContext EntityManager em;
public List<User> findByCustomQuery(String q) { return em.createQuery(...).getResultList(); }
} Defensive patterns
Strategy: validation
Validate before calling
// Verify each fragment interface has an implementation before building for i in $(grep -rl "interface .*Custom" src/main/java --include=*.java); do name=$(basename $i .java) grep -rq "implements $name" src/main/java || echo "MISSING implementation for $name" done
Prevention
- Always create the matching <Interface>Impl class together with the fragment interface
- Annotate implementations with @Component or @Repository
- Keep interface and implementation in the same module
When it happens
Trigger: A repository extends a custom interface (e.g. UserRepositoryCustom) but no @Component/@Repository class implements it; the implementing class was deleted or renamed; the implementation exists in an un-indexed JAR.
Common situations: Declaring the fragment interface but forgetting the implementation class; typo in implementor's 'implements' clause; implementation removed during refactoring; implementor in an external un-indexed dependency.
Related errors
- Method ${repositoryMethodDescription} cannot be parsed. Did
- Return type of method ${methodName} of Repository ${reposito
- ${t.name()} is not in the Quarkus Jandex index and cannot be
- spEL expressions are not currently supported. Offending meth
- Unsupported query type in @Query. Offending method is ${meth
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/a216c118cde41128.
Report an issue: GitHub.