{"id":"4fae935cbe505c3e","repo":"spring-projects/spring-framework","slug":"targetlistclass-must-not-be-null","errorCode":null,"errorMessage":"'targetListClass' must not be null","messagePattern":"'targetListClass' must not be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java","lineNumber":61,"sourceCode":"\n\n\t/**\n\t * Set the source List, typically populated via XML \"list\" elements.\n\t */\n\tpublic void setSourceList(List<?> sourceList) {\n\t\tthis.sourceList = sourceList;\n\t}\n\n\t/**\n\t * Set the class to use for the target List. Can be populated with a fully\n\t * qualified class name when defined in a Spring application context.\n\t * <p>Default is a {@code java.util.ArrayList}.\n\t * @see java.util.ArrayList\n\t */\n\t@SuppressWarnings(\"rawtypes\")\n\tpublic void setTargetListClass(@Nullable Class<? extends List> targetListClass) {\n\t\tif (targetListClass == null) {\n\t\t\tthrow new IllegalArgumentException(\"'targetListClass' must not be null\");\n\t\t}\n\t\tif (!List.class.isAssignableFrom(targetListClass)) {\n\t\t\tthrow new IllegalArgumentException(\"'targetListClass' must implement [java.util.List]\");\n\t\t}\n\t\tthis.targetListClass = targetListClass;\n\t}\n\n\n\t@Override\n\t@SuppressWarnings(\"rawtypes\")\n\tpublic Class<List> getObjectType() {\n\t\treturn List.class;\n\t}\n\n\t@Override\n\t@SuppressWarnings(\"unchecked\")\n\tprotected List<Object> createInstance() {\n\t\tif (this.sourceList == null) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java#L43-L79","documentation":"Error \"'targetListClass' must not be null\" thrown in spring-projects/spring-framework.","triggerScenarios":"Thrown at spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e8729d043887bf0d0baf91e062e909b56eb2b708","analyzedAt":"2026-08-04T19:07:39.725Z","schemaVersion":2}