{"id":"c29d18bad3815b7a","repo":"spring-projects/spring-framework","slug":"introductioninfo-defines-no-interfaces-to-introduc","errorCode":null,"errorMessage":"IntroductionInfo defines no interfaces to introduce: {introductionInfo}","messagePattern":"IntroductionInfo defines no interfaces to introduce: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java","lineNumber":74,"sourceCode":"\t * @see #addInterface\n\t */\n\tpublic DefaultIntroductionAdvisor(Advice advice) {\n\t\tthis(advice, (advice instanceof IntroductionInfo introductionInfo ? introductionInfo : null));\n\t}\n\n\t/**\n\t * Create a DefaultIntroductionAdvisor for the given advice.\n\t * @param advice the Advice to apply\n\t * @param introductionInfo the IntroductionInfo that describes\n\t * the interface to introduce (may be {@code null})\n\t */\n\tpublic DefaultIntroductionAdvisor(Advice advice, @Nullable IntroductionInfo introductionInfo) {\n\t\tAssert.notNull(advice, \"Advice must not be null\");\n\t\tthis.advice = advice;\n\t\tif (introductionInfo != null) {\n\t\t\tClass<?>[] introducedInterfaces = introductionInfo.getInterfaces();\n\t\t\tif (introducedInterfaces.length == 0) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"IntroductionInfo defines no interfaces to introduce: \" + introductionInfo);\n\t\t\t}\n\t\t\tfor (Class<?> ifc : introducedInterfaces) {\n\t\t\t\taddInterface(ifc);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Create a DefaultIntroductionAdvisor for the given advice.\n\t * @param advice the Advice to apply\n\t * @param ifc the interface to introduce\n\t */\n\tpublic DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> ifc) {\n\t\tAssert.notNull(advice, \"Advice must not be null\");\n\t\tthis.advice = advice;\n\t\taddInterface(ifc);\n\t}","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java#L56-L92","documentation":"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.","triggerScenarios":"new DefaultIntroductionAdvisor(advice, introductionInfo) where introductionInfo.getInterfaces() returns a zero-length array.","commonSituations":"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.","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."],"exampleFix":"// before\npublic class EmptyIntro implements IntroductionInfo {\n  public Class<?>[] getInterfaces() { return new Class<?>[0]; }\n}\nnew DefaultIntroductionAdvisor(advice, new EmptyIntro()); // -> error 116\n\n// after\npublic class ServiceIntro extends DelegatingIntroductionInterceptor implements Lockable { ... }\nnew DefaultIntroductionAdvisor(new ServiceIntro());","handlingStrategy":"validation","validationCode":"IntroductionInfo info = ...;\nif (info == null || info.getInterfaces() == null || info.getInterfaces().length == 0) {\n    throw new IllegalArgumentException(\"IntroductionInfo must declare >= 1 interface\");\n}","typeGuard":"boolean hasInterfaces(IntroductionInfo info) {\n    return info != null && info.getInterfaces() != null && info.getInterfaces().length > 0;\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["spring-aop","introduction","configuration","validation"],"analyzedSha":"e8729d043887bf0d0baf91e062e909b56eb2b708","analyzedAt":"2026-08-04T19:07:39.725Z","schemaVersion":2}