pentaho/pentaho-kettle · error · AuthenticationFactoryException
DefaultAuthenticationConsumerFactory.Consume
DefaultAuthenticationConsumerFactory.Consume
Error message
DefaultAuthenticationConsumerFactory.Consume
What it means
DefaultAuthenticationConsumerFactory scans public methods to find the consume() entry point; if no suitable method is found it throws AuthenticationFactoryException with key 'DefaultAuthenticationConsumerFactory.Consume'. The consumer class therefore does not implement the expected consume contract.
Solutions
- Implement a public method named consume(...) taking exactly one parameter (the consumed authentication type) with a meaningful return type.
- Ensure the method is public and not buried behind unrelated overloads that break the selection logic.
- Verify the class passed to the factory actually implements the consumer interface.
Example fix
// before
public class MyConsumer { public void run(PasswordAuthentication p) {} }
// after
public class MyConsumer {
public String consume(PasswordAuthentication p) { return doWork(p); }
} Defensive patterns
Strategy: validation
Validate before calling
boolean hasConsume = Arrays.stream(MyConsumer.class.getMethods())
.anyMatch(m -> m.getName().equals("consume") && m.getParameterTypes().length == 1);
if (!hasConsume) throw new IllegalStateException("Missing public consume(T) method"); Try / catch
try { new DefaultAuthenticationConsumerFactory(MyConsumer.class); } catch (AuthenticationFactoryException e) { logError("Consumer lacks consume() method", e); } Prevention
- Always implement the public consume(T) method in consumer classes
- Add reflection-based contract tests for consumer classes
- Keep consume() un-renamed and public
When it happens
Trigger: Registering a consumer class with no public method whose name matches the expected convention (consume/returns non-void taking one parameter) — the scan loop ends with consumeMethod == null.
Common situations: Consumer classes that renamed or overloaded consume(); method made private; a class passed in that isn't actually an AuthenticationConsumer implementation.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- DefaultAuthenticationConsumerFactory.Constructor
- DefaultAuthenticationConsumerFactory.Constructor.Arg
- Attempting to create PDI Repository with no Active…
- Auth error
- AuthenticationManager.ConsumedTypeError
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/47937cc9d22baa51.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/core/auth/core/impl/DefaultAuthenticationConsumerFactory.java:62
throw new AuthenticationFactoryException( BaseMessages.getString( PKG,
"DefaultAuthenticationConsumerFactory.Constructor.Arg", getClass().getName(), consumerClass
.getCanonicalName() ) );
}
Method consumeMethod = null;
Class<?> consumedType = Object.class;
for ( Method method : consumerClass.getMethods() ) {
if ( "consume".equals( method.getName() ) ) {
Class<?>[] methodParameterTypes = method.getParameterTypes();
if ( methodParameterTypes.length == 1 && consumedType.isAssignableFrom( methodParameterTypes[0] ) ) {
consumeMethod = method;
consumedType = methodParameterTypes[0];
}
}
}
if ( consumeMethod == null ) {
throw new AuthenticationFactoryException( BaseMessages.getString( PKG,
"DefaultAuthenticationConsumerFactory.Consume", consumerClass.getCanonicalName() ) );
}
this.consumedType = (Class<Object>) consumeMethod.getParameterTypes()[0];
this.returnType = (Class<Object>) consumeMethod.getReturnType();
this.createArgType = (Class<Object>) parameterTypes[0];
}
@Override
public Class<Object> getConsumedType() {
return consumedType;
}
@Override
public Class<Object> getReturnType() {
return returnType;
}
@OverrideView on GitHub (pinned to f3058517a1)