theonedev/onedev · error · ExplicitException
Dependency property not found: X
Error message
Dependency property not found: X
What it means
A bean property annotated @DependsOn(property="...") references another property that must exist in the same bean so the schema can emit an if/then condition. processBean throws this ExplicitException when the referenced dependency property is not found in the bean's property map.
Source
Thrown at server-core/src/main/java/io/onedev/server/ai/BuildSpecSchema.java:250
}
}
}
if (!dependents.isEmpty()) {
var allOfNode = new ArrayList<Map<String, Object>>();
currentNode.put("allOf", allOfNode);
for (var dependent: dependents) {
var allOfItemNode = new HashMap<String, Object>();
allOfNode.add(allOfItemNode);
var dependsOns = dependent.getRight();
var ifNode = new HashMap<String, Object>();
allOfItemNode.put("if", ifNode);
var ifAllOfNode = new ArrayList<Map<String, Object>>();
ifNode.put("allOf", ifAllOfNode);
for (var dependsOn: dependsOns) {
var dependencyProperty = propertyMap.get(dependsOn.property());
if (dependencyProperty == null)
throw new ExplicitException("Dependency property not found: " + dependsOn.property());
ifAllOfNode.add(buildDependsOnCondition(dependsOn, dependencyProperty));
}
var branchNode = new HashMap<String, Object>();
allOfItemNode.put("then", branchNode);
var property = dependent.getLeft();
var branchPropsNode = new HashMap<String, Object>();
branchNode.put("properties", branchPropsNode);
var propNode = new HashMap<String, Object>();
branchPropsNode.put(property.getPropertyName(), propNode);
processProperty(propNode, bean, property);
if (property.isPropertyRequired()) {
var requiredList = new ArrayList<String>();
requiredList.add(property.getPropertyName());
branchNode.put("required", requiredList);
}
}View on GitHub (pinned to d44925c47c)
Solutions
- Correct the @DependsOn annotation value to exactly match the dependency property's name.
- Restore or rename the referenced property if it was deleted or renamed.
- Verify the dependency property is not excluded from schema processing in the enclosing processBean call.
Example fix
// before
@DependsOn(property="executorTyp")
public String getImage() {...}
// after
@DependsOn(property="executorType")
public String getImage() {...} Defensive patterns
Strategy: validation
Validate before calling
for (var p : properties) {
for (var d : p.getAnnotationsByType(DependsOn.class)) {
if (!propertyNames.contains(d.property()))
throw new IllegalStateException("@DependsOn target missing: " + d.property());
}
} Try / catch
try {
schema = BuildSpecSchema.generate(specClass);
} catch (ExplicitException e) {
if (e.getMessage().startsWith("Dependency property not found")) {
// fix the @DependsOn value named in the message
}
} Prevention
- Keep @DependsOn values in sync when renaming properties.
- Grep bean classes for @DependsOn during refactors.
- Add schema-generation tests covering dependency annotations.
When it happens
Trigger: A @DependsOn annotation on a spec property names a property string that does not match any actual property of the bean, so propertyMap.get(dependsOn.property()) returns null.
Common situations: Typo in the @DependsOn value, renaming/removing the dependency property without updating annotations, or referencing a property inherited/excluded from schema processing.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Unknown collection element class (bean: X, property: Y)
- Property 'type' is reserved (class: X)
- Unsupported type: X
- Malformed build spec
- Circular template usages (
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/3e6fd78ccbff066e.
Report an issue: GitHub.