apache/dolphinscheduler · error · TaskException
DMS task init error
Error message
DMS task init error
What it means
initDmsHook builds a DmsHook and copies DmsParameters properties onto it with commons-beanutils BeanUtils.copyProperties. If the reflective copy throws (or its nested InvocationTargetException occurs) a TaskException 'DMS task init error' is thrown during task init.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java:219
* @return true if stop task when cdc type and cdcStopPosition is not set, else return false
*/
public Boolean isStopTaskWhenCdc() {
ReplicationTask replicationTask = dmsHook.describeReplicationTasks();
String migrationType = replicationTask.getMigrationType();
return migrationType.contains("cdc") && parameters.getCdcStopPosition() == null;
}
/**
* init dms hook
*/
public void initDmsHook() throws TaskException {
convertJsonParameters();
dmsHook = new DmsHook();
try {
BeanUtils.copyProperties(dmsHook, parameters);
} catch (Exception e) {
throw new TaskException("DMS task init error", e);
}
if (!StringUtils.isNotEmpty(parameters.getStartReplicationTaskType())) {
if (parameters.getIsRestartTask()) {
dmsHook.setStartReplicationTaskType(DmsHook.START_TYPE.RELOAD_TARGET);
} else {
dmsHook.setStartReplicationTaskType(DmsHook.START_TYPE.START_REPLICATION);
}
}
}
/**
* convert json parameters to dms parameters
*/
public void convertJsonParameters() throws TaskException {
// create a new parameter object using the json data if the json data is not empty
if (parameters.getIsJsonFormat() && parameters.getJsonData() != null) {
String jsonData = ParameterUtils.convertParameterPlaceholders(parameters.getJsonData(),View on GitHub (pinned to 02eac45a1b)
Solutions
- Check the 'Caused by' in the worker log for the real reflection/setter error and fix the offending parameter or DmsHook setter.
- Compare DmsParameters fields with DmsHook setters — ensure every copied property has a matching compatible setter.
- Pin a compatible commons-beanutils version in the plugin pom.xml to avoid classpath conflicts with other plugins.
- If a customjsonData path was used, verify the parsed DmsParameters contain only valid values.
Example fix
// before: DmsHook has no setter for new field -> copyProperties throws
private String newOption; // in DmsParameters, no setter in DmsHook
// after: add a matching setter in DmsHook
public void setNewOption(String newOption) { this.newOption = newOption; } Defensive patterns
Strategy: try-catch
Try / catch
try {
init();
} catch (TaskException e) {
log.error("DMS init failed", e.getCause()); // cause holds the BeanUtils reflection error
} Prevention
- Keep DmsParameters fields and DmsHook setters in sync; add a setter for every copied property.
- Pin commons-beanutils version in the plugin pom to avoid shared-classloader conflicts.
- Make DmsHook setters tolerant (no throwing validation) of copied values.
- Run plugin unit tests that call initDmsHook after any field additions.
When it happens
Trigger: BeanUtils.copyProperties(dmsHook, parameters) throws inside initDmsHook — e.g. a property type mismatch between DmsParameters and DmsHook, an exception thrown by a DmsHook setter, or reflection/NoSuchMethod issues after a version change.
Common situations: A new field added to DmsParameters with no compatible setter in DmsHook; incompatible commons-beanutils version on the classpath (plugin classloader is shared); a DmsHook setter validating and rejecting a parameter value.
Related errors
- invalid type : <type>
- Failed to insert plugin definition, pluginName: %s, pluginTy
- datasource plugin '%s' is not found
- Update Kerberos environment failed.
- Parameter types: " + Lists.newArrayList(standardRpcRequest.g
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/7b355ddb7e007529.
Report an issue: GitHub.