{"record":{"id":"4cacb3358aa66b69","repo":"spring-projects/spring-framework","slug":"class-name-classname-is-not-a-known-auto-proxy","errorCode":null,"errorMessage":"Class name [{className}] is not a known auto-proxy creator class","messagePattern":"Class name \\[(.+?)\\] is not a known auto-proxy creator class","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java","lineNumber":155,"sourceCode":"\t\tbeanDefinition.setSource(source);\n\t\tbeanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);\n\t\tbeanDefinition.getPropertyValues().add(\"order\", Ordered.HIGHEST_PRECEDENCE);\n\t\tregistry.registerBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME, beanDefinition);\n\t\treturn beanDefinition;\n\t}\n\n\tprivate static int findPriorityForClass(Class<?> clazz) {\n\t\treturn APC_PRIORITY_LIST.indexOf(clazz);\n\t}\n\n\tprivate static int findPriorityForClass(@Nullable String className) {\n\t\tfor (int i = 0; i < APC_PRIORITY_LIST.size(); i++) {\n\t\t\tClass<?> clazz = APC_PRIORITY_LIST.get(i);\n\t\t\tif (clazz.getName().equals(className)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Class name [\" + className + \"] is not a known auto-proxy creator class\");\n\t}\n\n}\n","sourceCodeStart":137,"sourceCodeEnd":160,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/69bf83ad716d0cfc4b0520a19b4d8b24c79d1538/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java#L137-L160","documentation":"Thrown as an IllegalArgumentException from AopConfigUtils.findPriorityForClass(String className) when the supplied class name does not match any of the three registered auto-proxy creator classes (InfrastructureAdvisorAutoProxyCreator, AspectJAwareAdvisorAutoProxyCreator, AnnotationAwareAspectJAutoProxyCreator). This is used internally during auto-proxy creator escalation/registration and indicates the bean class name stored under the internal auto-proxy creator bean name is not a recognized creator type.","triggerScenarios":"An auto-proxy creator bean registered under AUTO_PROXY_CREATOR_BEAN_NAME with an unexpected beanClassName; a third-party namespace handler or a custom BeanDefinitionRegistryPostProcessor that overwrote the internal bean name with a different class; an attempt to escalate/replace the auto-proxy creator with a non-standard class.","commonSituations":"A misbehaving third-party library that re-registers the internal auto-proxy creator bean name with its own class; manual BeanDefinition manipulation that assigns a wrong class name to the reserved bean name; a stale/corrupted BeanDefinition after a partial context refresh.","solutions":["Avoid registering beans under the reserved name org.springframework.aop.config.internalAutoProxyCreator.","Identify and fix the component (third-party handler or custom post-processor) that overwrote the auto-proxy creator bean class name.","Register custom auto-proxy creators under their own bean name rather than the reserved infrastructure name."],"exampleFix":"// before\nregistry.registerBeanDefinition(\n    AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME,\n    new RootBeanDefinition(MyCustomAutoProxyCreator.class)); // not in priority list -> throws on escalation\n// after\nregistry.registerBeanDefinition(\n    \"myCustomAutoProxyCreator\",\n    new RootBeanDefinition(MyCustomAutoProxyCreator.class));","handlingStrategy":"validation","validationCode":"import org.springframework.aop.config.AopConfigUtils;\nimport org.springframework.beans.factory.config.BeanDefinition;\n\npublic static boolean isKnownAutoProxyCreator(String beanClassName) {\n    return \"org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator\".equals(beanClassName)\n        || \"org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator\".equals(beanClassName)\n        || \"org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator\".equals(beanClassName);\n}\n\n// before any escalation logic that calls findPriorityForClass(className):\nif (!isKnownAutoProxyCreator(beanDefinition.getBeanClassName())) {\n    throw new IllegalStateException(\"Unexpected auto-proxy creator class: \" + beanDefinition.getBeanClassName());\n}","typeGuard":null,"tryCatchPattern":"// AopConfigUtils is internal; callers rarely invoke it directly. If extending registration:\ntry {\n    // registration/escalation\n} catch (IllegalArgumentException ex) {\n    if (ex.getMessage().contains(\"not a known auto-proxy creator class\")) {\n        // register your creator under a different bean name\n    } else throw ex;\n}","preventionTips":["Never register beans under the reserved name internalAutoProxyCreator with a non-standard class.","Register custom auto-proxy creators under their own unique bean name.","Audit BeanDefinitionRegistryPostProcessors that may overwrite the reserved bean."],"tags":["spring-aop","auto-proxy","configuration","internal"],"backgroundTag":null,"analyzedSha":"69bf83ad716d0cfc4b0520a19b4d8b24c79d1538","analyzedAt":"2026-08-09T15:32:58.770Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}