theonedev/onedev · error · ExplicitException
Dependency property not found: ${property}
Error message
Dependency property not found: ${property} What it means
PropertyDescriptor.isPropertyVisible evaluates @DependsOn annotations on a bean property. For each DependsOn, it looks up the referenced dependency property in the bean's BeanDescriptor; if that property does not exist, it throws this ExplicitException instead of silently treating the property as visible/invisible. This catches broken @DependsOn(property="...") references at edit-form render time.
Source
Thrown at server-core/src/main/java/io/onedev/server/web/editable/PropertyDescriptor.java:177
Set<String> prevDependencyPropertyNames = new HashSet<>(getDependencyPropertyNames());
var hierarchicalContext = hierarchicalContexts.get(getPropertyName());
if (hierarchicalContext != null)
HierarchicalContext.push(hierarchicalContext);
try {
/*
* Sometimes, the dependency may include properties introduced while evaluating available choices
* of a choice input. We clear it temporarily here in order to make visibility of the property
* consistent of BeanViewer, Issue.isFieldVisible, or Build.isParamVisible
*/
getDependencyPropertyNames().clear();
ShowCondition showCondition = getPropertyGetter().getAnnotation(ShowCondition.class);
if (showCondition != null && !(boolean)ReflectionUtils.invokeStaticMethod(getBeanClass(), showCondition.value()))
return false;
for (DependsOn dependsOn : getPropertyGetter().getAnnotationsByType(DependsOn.class)) {
var dependencyProperty = beanDescriptor.getProperty(dependsOn.property());
if (dependencyProperty == null) {
throw new ExplicitException("Dependency property not found: " + dependsOn.property());
}
var dependencyPropertyValue = EditContext.get().getInputValue(dependsOn.property());
if (!DependsOnUtils.isPropertyVisible(dependsOn, dependencyProperty.getPropertyClass(), dependencyPropertyValue))
return false;
}
getDependencyPropertyNames().remove(getPropertyName());
for (String dependencyPropertyName: getDependencyPropertyNames()) {
Set<String> copyOfCheckedPropertyNames = new HashSet<>(checkedPropertyNames);
if (!beanDescriptor.getProperty(dependencyPropertyName).isPropertyVisible(hierarchicalContexts, beanDescriptor, copyOfCheckedPropertyNames))
return false;
}
return true;
} finally {
getDependencyPropertyNames().addAll(prevDependencyPropertyNames);
if (hierarchicalContext != null)
HierarchicalContext.pop();
}
}View on GitHub (pinned to d44925c47c)
Solutions
- Check every @DependsOn(property="...") on the failing property and correct the name to an existing property on the same bean.
- After refactors, grep for DependsOn annotations referencing renamed/deleted fields and update them.
- Ensure the dependency property is declared on the same class (not a different nesting level of the edit form).
- Rebuild/redeploy after fixing so the edited class is loaded.
Example fix
// before
@DependsOn(property="envVarible")
@Editable(name="Value")
public String getValue() { ... }
// after
@DependsOn(property="envVariable")
@Editable(name="Value")
public String getValue() { ... } Defensive patterns
Strategy: validation
Validate before calling
// at class-load/test time, validate all @DependsOn references
for (PropertyDescriptor pd : new BeanDescriptor(MyBean.class).getProperties()) {
for (DependsOn d : pd.getPropertyGetter().getAnnotationsByType(DependsOn.class)) {
if (new BeanDescriptor(MyBean.class).getProperty(d.property()) == null)
throw new IllegalStateException("@DependsOn references missing property: " + d.property());
}
} Try / catch
try {
boolean visible = propertyDescriptor.isPropertyVisible(...);
} catch (ExplicitException e) {
log.error("Broken @DependsOn on property {}: {}", propertyDescriptor.getPropertyName(), e.getMessage());
throw e; // fix the annotation; visibility cannot be defaulted safely
} Prevention
- When renaming a bean property, always grep the class for @DependsOn referencing the old name.
- Keep @DependsOn property names next to the annotated property with a comment linking both fields.
- Add a unit test that instantiates the BeanDescriptor for parameter classes to catch broken dependency references early.
- Only depend on properties declared in the same bean class.
When it happens
Trigger: A property annotated @DependsOn(property="X") (possibly repeated) where no property named X exists on the same bean class — e.g. a typo in the annotation, X was renamed/removed, or X lives on a different (parent/child) bean.
Common situations: Writing a custom job/issue/build parameter class with @DependsOn; refactoring a bean and renaming a field without updating @DependsOn annotations; upgrading OneDev where a dependency field name changed.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- No property found with name: ${propertyNameOrDisplayName}
- @Code annotation should be applied to a String or List<Strin
- Issue schedule permission required to set iterations
- Iteration '${iterationName}' not found
- No permission to update issue fields
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/a18972433207c648.
Report an issue: GitHub.