provectus/kafka-ui · error · ValidationException
filePath can't be set for built-in serde type
Error message
filePath can't be set for built-in serde type
What it means
When a serde is configured by explicitly naming the built-in class (createSerdeWithBuiltInClass), the class comes from the application classpath, so an external filePath is not applicable; setting it throws ValidationException('filePath can't be set for built-in serde type').
Solutions
- Remove the filePath property from the entry
- Keep only the built-in class designation plus any needed properties
Example fix
// before
serde:
- name: my-protobuf
className: com.provectus.kafka.ui.serdes.builtin.ProtobufSerde
filePath: /opt/serdes/x.jar
// after
serde:
- name: my-protobuf
className: com.provectus.kafka.ui.serdes.builtin.ProtobufSerde Defensive patterns
Strategy: validation
Validate before calling
if (isBuiltInClass(cfg.getClassName()) && cfg.getFilePath() != null)
throw new IllegalArgumentException("filePath not allowed with built-in serde class"); Try / catch
try {
serde = createSerdeFromConfig(cfg, ...);
} catch (ValidationException e) {
log.error("Bad serde config for {}: {}", cfg.getName(), e.getMessage());
throw e;
} Prevention
- Don't mix custom and built-in serde config styles in one entry
- Remove filePath when className resolves to a BuiltInSerde
- Review serde config after refactoring between styles
When it happens
Trigger: Configuring a serde via the built-in-class route (className referencing a BuiltInSerde class) while also setting filePath.
Common situations: Mixing custom-serde and built-in-serde config styles in one entry after refactoring configuration.
Related errors
- className can't be set for built-in serde
- filePath can't be set for built-in serde types
- serde is not configured
- 'name' property not set for serde
- Multiple serdes with same name
AI-assisted analysis of provectus/kafka-ui@83b5a60cc0 (2026-09-08).
Data as JSON: /api/errors/8c0a28fe03739e61.
Report an issue: GitHub.
Appendix: source
Thrown at kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/SerdesInitializer.java:236
);
}
private boolean autoConfigureSerde(BuiltInSerde serde, PropertyResolver clusterProps, PropertyResolver globalProps) {
if (serde.canBeAutoConfigured(clusterProps, globalProps)) {
serde.autoConfigure(clusterProps, globalProps);
return true;
}
return false;
}
@SneakyThrows
private SerdeInstance createSerdeWithBuiltInClass(Class<? extends BuiltInSerde> clazz,
SerdeConfig serdeConfig,
PropertyResolver serdeProps,
PropertyResolver clusterProps,
PropertyResolver globalProps) {
if (serdeConfig.getFilePath() != null) {
throw new ValidationException("filePath can't be set for built-in serde type");
}
BuiltInSerde serde = createSerdeInstance(clazz);
serde.configure(serdeProps, clusterProps, globalProps);
return new SerdeInstance(
serdeConfig.getName(),
serde,
nullablePattern(serdeConfig.getTopicKeysPattern()),
nullablePattern(serdeConfig.getTopicValuesPattern()),
null
);
}
@SneakyThrows
private <T extends Serde> T createSerdeInstance(Class<T> clazz) {
return clazz.getDeclaredConstructor().newInstance();
}
private SerdeInstance loadAndInitCustomSerde(SerdeConfig serdeConfig,View on GitHub (pinned to 83b5a60cc0)