{"id":"6df61f38fd93992c","repo":"spring-projects/spring-framework","slug":"element-access-not-supported-for-custom-objectpr","errorCode":null,"errorMessage":"Element access not supported - for custom ObjectProvider classes, implement stream() to enable all other methods","messagePattern":"Element access not supported - for custom ObjectProvider classes, implement stream\\(\\) to enable all other methods","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java","lineNumber":237,"sourceCode":"\t */\n\t@Override\n\tdefault Iterator<T> iterator() {\n\t\treturn stream().iterator();\n\t}\n\n\t/**\n\t * Return a sequential {@link Stream} over all matching object instances,\n\t * without specific ordering guarantees (but typically in registration order).\n\t * <p>Note: The result may be filtered by default according to qualifiers on the\n\t * injection point versus target beans and the general autowire candidate status\n\t * of matching beans. For custom filtering against type-matching candidates, use\n\t * {@link #stream(Predicate)} instead (potentially with {@link #UNFILTERED}).\n\t * @since 5.1\n\t * @see #iterator()\n\t * @see #orderedStream()\n\t */\n\tdefault Stream<T> stream() {\n\t\tthrow new UnsupportedOperationException(\"Element access not supported - \" +\n\t\t\t\t\"for custom ObjectProvider classes, implement stream() to enable all other methods\");\n\t}\n\n\t/**\n\t * Return a sequential {@link Stream} over all matching object instances,\n\t * pre-ordered according to the factory's common order comparator.\n\t * <p>In a standard Spring application context, this will be ordered\n\t * according to {@link org.springframework.core.Ordered} conventions,\n\t * and in case of annotation-based configuration also considering the\n\t * {@link org.springframework.core.annotation.Order} annotation,\n\t * analogous to multi-element injection points of list/array type.\n\t * <p>The default method applies an {@link OrderComparator} to the\n\t * {@link #stream()} method. You may override this to apply an\n\t * {@link org.springframework.core.annotation.AnnotationAwareOrderComparator}\n\t * if necessary.\n\t * <p>Note: The result may be filtered by default according to qualifiers on the\n\t * injection point versus target beans and the general autowire candidate status\n\t * of matching beans. For custom filtering against type-matching candidates, use","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java#L219-L255","documentation":"Error \"Element access not supported - for custom ObjectProvider classes, implement stream() to enable all other methods\" thrown in spring-projects/spring-framework.","triggerScenarios":"Thrown at spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java:237 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}