pentaho/pentaho-kettle · error · AuthenticationFactoryException
DefaultAuthenticationConsumerFactory.Constructor.Arg
DefaultAuthenticationConsumerFactory.Constructor.Arg
Error message
DefaultAuthenticationConsumerFactory.Constructor.Arg
What it means
After picking the single public constructor, DefaultAuthenticationConsumerFactory requires it to take exactly one parameter; a zero-arg or multi-arg constructor triggers AuthenticationFactoryException with key 'DefaultAuthenticationConsumerFactory.Constructor.Arg'. The framework creates consumers by passing one argument (the authentication provider).
Solutions
- Change the consumer to a single-argument public constructor accepting the provider/consumed dependency.
- Bundle extra dependencies into one parameter object, or inject them another way before consume() runs.
- Use a custom AuthenticationConsumerFactory instead of the default if the constructor contract cannot be met.
Example fix
// before
public MyConsumer(AuthenticationProvider p, Log log) {}
// after
public MyConsumer(AuthenticationProvider p) { this.log = Log.getInstance(); } Defensive patterns
Strategy: validation
Validate before calling
Constructor<?> c = MyConsumer.class.getConstructors()[0];
if (c.getParameterTypes().length != 1) {
throw new IllegalStateException("Consumer constructor must take exactly one argument");
} Try / catch
try { new DefaultAuthenticationConsumerFactory(MyConsumer.class); } catch (AuthenticationFactoryException e) { logError("Consumer must take one constructor arg", e); } Prevention
- Design consumers with a single-argument constructor
- Move auxiliary dependencies out of the constructor
- Write a unit test that instantiates the factory for every consumer
When it happens
Trigger: Registering a consumer class whose single public constructor has parameterTypes.length != 1 (e.g. a no-arg constructor or one taking two dependencies).
Common situations: DI-style consumers with several injected dependencies; default constructors on consumers written for standalone use; Lombok @AllArgsConstructor over multiple fields.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- DefaultAuthenticationConsumerFactory.Constructor
- Can't create object
- Constructor not found for
- DefaultAuthenticationConsumerFactory.Consume
- Unable to get the constructor for
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/e7bc49bbe6e37116.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/core/auth/core/impl/DefaultAuthenticationConsumerFactory.java:44
private static final Class<?> PKG = DefaultAuthenticationConsumerFactory.class;
private final Constructor<?> constructor;
private final Class<Object> consumedType;
private final Class<Object> returnType;
private final Class<Object> createArgType;
@SuppressWarnings( "unchecked" )
public DefaultAuthenticationConsumerFactory( Class<?> consumerClass ) throws AuthenticationFactoryException {
Constructor<?>[] constructors = consumerClass.getConstructors();
if ( constructors.length != 1 ) {
throw new AuthenticationFactoryException( BaseMessages.getString( PKG,
"DefaultAuthenticationConsumerFactory.Constructor", getClass().getName(),
consumerClass.getCanonicalName() ) );
}
constructor = constructors[0];
Class<?>[] parameterTypes = constructor.getParameterTypes();
if ( parameterTypes.length != 1 ) {
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,View on GitHub (pinned to f3058517a1)