spring-projects/spring-framework · error · IllegalArgumentException
IntroductionInfo defines no interfaces to introduce: {introd
Error message
IntroductionInfo defines no interfaces to introduce: {introductionInfo} What it means
DefaultIntroductionAdvisor constructor throws IllegalArgumentException when the supplied IntroductionInfo reports zero interfaces via getInterfaces(). An introduction must add at least one interface to the proxy; an empty interface set leaves nothing to introduce and is treated as a programming error.
Source
Thrown at spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java:74
* @see #addInterface
*/
public DefaultIntroductionAdvisor(Advice advice) {
this(advice, (advice instanceof IntroductionInfo introductionInfo ? introductionInfo : null));
}
/**
* Create a DefaultIntroductionAdvisor for the given advice.
* @param advice the Advice to apply
* @param introductionInfo the IntroductionInfo that describes
* the interface to introduce (may be {@code null})
*/
public DefaultIntroductionAdvisor(Advice advice, @Nullable IntroductionInfo introductionInfo) {
Assert.notNull(advice, "Advice must not be null");
this.advice = advice;
if (introductionInfo != null) {
Class<?>[] introducedInterfaces = introductionInfo.getInterfaces();
if (introducedInterfaces.length == 0) {
throw new IllegalArgumentException(
"IntroductionInfo defines no interfaces to introduce: " + introductionInfo);
}
for (Class<?> ifc : introducedInterfaces) {
addInterface(ifc);
}
}
}
/**
* Create a DefaultIntroductionAdvisor for the given advice.
* @param advice the Advice to apply
* @param ifc the interface to introduce
*/
public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> ifc) {
Assert.notNull(advice, "Advice must not be null");
this.advice = advice;
addInterface(ifc);
}View on GitHub (pinned to e8729d0438)
Solutions
- Ensure the IntroductionInfo (or IntroductionInfoSupport delegate) reports at least one interface.
- Use the DefaultIntroductionAdvisor(DynamicIntroductionAdvice, Class) constructor to name the interface explicitly.
- Make the delegate class implement the interface you intend to introduce.
Example fix
// before
public class EmptyIntro implements IntroductionInfo {
public Class<?>[] getInterfaces() { return new Class<?>[0]; }
}
new DefaultIntroductionAdvisor(advice, new EmptyIntro()); // -> error 116
// after
public class ServiceIntro extends DelegatingIntroductionInterceptor implements Lockable { ... }
new DefaultIntroductionAdvisor(new ServiceIntro()); Defensive patterns
Strategy: validation
Validate before calling
IntroductionInfo info = ...;
if (info == null || info.getInterfaces() == null || info.getInterfaces().length == 0) {
throw new IllegalArgumentException("IntroductionInfo must declare >= 1 interface");
} Type guard
boolean hasInterfaces(IntroductionInfo info) {
return info != null && info.getInterfaces() != null && info.getInterfaces().length > 0;
} Prevention
- Ensure IntroductionInfoSupport delegates report at least one interface.
- Prefer the (DynamicIntroductionAdvice, Class) constructor to be explicit.
- Unit-test advisor construction to catch empty introductions early.
When it happens
Trigger: new DefaultIntroductionAdvisor(advice, introductionInfo) where introductionInfo.getInterfaces() returns a zero-length array.
Common situations: Subclassing DelegatingIntroductionInterceptor/IntroductionInfoSupport without populating the interface map; passing a custom IntroductionInfo that lazily computes interfaces but returns empty at construction; delegate object implementing no interfaces.
Related errors
- Class '{}' is not an @AspectJ aspect
- DynamicIntroductionAdvice may only be added as part of Intro
- Placeholder [{match}] is not valid
- MethodInvocation is not a Spring ProxyMethodInvocation: {}
- 'argumentNames' property of AbstractAspectJAdvice contains a
AI-assisted analysis of spring-projects/spring-framework@e8729d0438 (2026-08-04).
Data as JSON: /data/errors/c29d18bad3815b7a.json.
Report an issue: GitHub.