{"id":"0938f9fe2507c50a","repo":"spring-projects/spring-framework","slug":"retrieval-with-arguments-not-supported-for-custom","errorCode":null,"errorMessage":"Retrieval with arguments not supported -for custom ObjectProvider classes, implement getObject(Object...) for your purposes","messagePattern":"Retrieval with arguments not supported -for custom ObjectProvider classes, implement getObject\\(Object\\.\\.\\.\\) for your purposes","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java","lineNumber":109,"sourceCode":"\t\tT result = it.next();\n\t\tif (it.hasNext()) {\n\t\t\tthrow new NoUniqueBeanDefinitionException(Object.class, 2, \"more than 1 matching bean\");\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return an instance (possibly shared or independent) of the object\n\t * managed by this factory.\n\t * <p>Allows for specifying explicit construction arguments, along the\n\t * lines of {@link BeanFactory#getBean(String, Object...)}.\n\t * @param args arguments to use when creating a corresponding instance\n\t * @return an instance of the bean\n\t * @throws BeansException in case of creation errors\n\t * @see #getObject()\n\t */\n\tdefault T getObject(@Nullable Object... args) throws BeansException {\n\t\tthrow new UnsupportedOperationException(\"Retrieval with arguments not supported -\" +\n\t\t\t\t\"for custom ObjectProvider classes, implement getObject(Object...) for your purposes\");\n\t}\n\n\t/**\n\t * Return an instance (possibly shared or independent) of the object\n\t * managed by this factory.\n\t * @return an instance of the bean, or {@code null} if not available\n\t * @throws BeansException in case of creation errors\n\t * @see #getObject()\n\t */\n\tdefault @Nullable T getIfAvailable() throws BeansException {\n\t\ttry {\n\t\t\treturn getObject();\n\t\t}\n\t\tcatch (NoUniqueBeanDefinitionException ex) {\n\t\t\tthrow ex;\n\t\t}\n\t\tcatch (NoSuchBeanDefinitionException ex) {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java#L91-L127","documentation":"Error \"Retrieval with arguments not supported -for custom ObjectProvider classes, implement getObject(Object...) for your purposes\" thrown in spring-projects/spring-framework.","triggerScenarios":"Thrown at spring-beans/src/main/java/org/springframework/beans/factory/ObjectProvider.java:109 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}