{"id":"7e4fa93eecdc2531","repo":"spring-projects/spring-framework","slug":"propertypath-is-required","errorCode":null,"errorMessage":"'propertyPath' is required","messagePattern":"'propertyPath' is required","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java","lineNumber":187,"sourceCode":"\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Specify 'targetObject' or 'targetBeanName' in combination with 'propertyPath'\");\n\t\t\t}\n\n\t\t\t// No other properties specified: check bean name.\n\t\t\tint dotIndex;\n\t\t\tif (this.beanName == null || (dotIndex = this.beanName.indexOf('.')) <= 0) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Neither 'targetObject' nor 'targetBeanName' specified, and PropertyPathFactoryBean \" +\n\t\t\t\t\t\t\"bean name '\" + this.beanName + \"' does not follow 'beanName.property' syntax\");\n\t\t\t}\n\t\t\ttargetBeanName = this.beanName.substring(0, dotIndex);\n\t\t\tthis.targetBeanName = targetBeanName;\n\t\t\tthis.propertyPath = this.beanName.substring(dotIndex + 1);\n\t\t}\n\n\t\telse if (this.propertyPath == null) {\n\t\t\t// either targetObject or targetBeanName specified\n\t\t\tthrow new IllegalArgumentException(\"'propertyPath' is required\");\n\t\t}\n\n\t\tif (this.targetBeanWrapper == null && StringUtils.hasLength(targetBeanName) &&\n\t\t\t\tthis.beanFactory.isSingleton(targetBeanName)) {\n\t\t\t// Eagerly fetch singleton target bean, and determine result type.\n\t\t\tObject bean = this.beanFactory.getBean(targetBeanName);\n\t\t\tthis.targetBeanWrapper = PropertyAccessorFactory.forBeanPropertyAccess(bean);\n\t\t\tthis.resultType = this.targetBeanWrapper.getPropertyType(this.propertyPath);\n\t\t}\n\t}\n\n\n\t@Override\n\tpublic @Nullable Object getObject() throws BeansException {\n\t\tBeanWrapper target = this.targetBeanWrapper;\n\t\tif (target != null) {\n\t\t\tif (logger.isWarnEnabled() && this.targetBeanName != null &&\n\t\t\t\t\tthis.beanFactory instanceof ConfigurableBeanFactory cbf &&","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java#L169-L205","documentation":"Error \"'propertyPath' is required\" thrown in spring-projects/spring-framework.","triggerScenarios":"Thrown at spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java:187 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}