{"record":{"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/69bf83ad716d0cfc4b0520a19b4d8b24c79d1538/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java#L56-L92","documentation":"Thrown by DefaultIntroductionAdvisor constructor (line 71-76) when the supplied IntroductionInfo returns an empty array from getInterfaces(). An introduction must add at least one interface to the proxy so the proxy can implement new behavior; an IntroductionInfo describing zero interfaces is meaningless and rejected with an IllegalArgumentException.","triggerScenarios":"Constructing 'new DefaultIntroductionAdvisor(advice, introductionInfo)' where the IntroductionInfo.getInterfaces() returns an empty Class[] array. Common with a DelegatingIntroductionInterceptor subclass whose getInterfaces() was overridden/implemented to return nothing, or an IntroductionInfo built from a class exposing no interfaces.","commonSituations":"Implementing IntroductionInfo and forgetting to populate the interface list. Subclassing DelegatingIntroductionInterceptor but the target introduces no interfaces. Passing an IntroductionInfo whose getInterfaces() is computed dynamically and yields empty under some configuration.","solutions":["Make your IntroductionInfo.getInterfaces() return at least one interface that the introduction advice actually implements.","Extend DelegatingIntroductionInterceptor and implement at least one marker/interface method so it exposes that interface.","If you only need plain advice (not an introduction), use DefaultPointcutAdvisor instead of DefaultIntroductionAdvisor."],"exampleFix":"// before\npublic class EmptyIntro implements IntroductionInfo {\n    public Class<?>[] getInterfaces() { return new Class<?>[0]; }\n}\nnew DefaultIntroductionAdvisor(advice, new EmptyIntro()); // fails\n\n// after\npublic class NamedBeanIntro extends DelegatingIntroductionInterceptor\n        implements NamedBean {\n    public String getBeanName() { return \"b\"; }\n}\nnew DefaultIntroductionAdvisor(new NamedBeanIntro());","handlingStrategy":"validation","validationCode":"IntroductionInfo info = /* ... */;\nif (info.getInterfaces() == null || info.getInterfaces().length == 0) {\n    throw new IllegalArgumentException(\"IntroductionInfo exposes no interfaces\");\n}","typeGuard":"static boolean hasInterfaces(IntroductionInfo info) {\n    Class<?>[] c = info.getInterfaces();\n    return c != null && c.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Implement at least one interface in your DelegatingIntroductionInterceptor subclass.","Unit-test IntroductionInfo.getInterfaces() to return a non-empty array.","Use DefaultPointcutAdvisor for plain advice that does not introduce interfaces."],"tags":["spring-aop","introduction","configuration","interfaces"],"backgroundTag":null,"analyzedSha":"69bf83ad716d0cfc4b0520a19b4d8b24c79d1538","analyzedAt":"2026-08-09T15:32:58.770Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}