flowable/flowable-engine · error · IllegalArgumentException
@ManagedAttribute can only be used on Java bean methods, was
Error message
@ManagedAttribute can only be used on Java bean methods, was: ${method} on bean: ${managedClass} What it means
MBeanInfoAssembler processes methods annotated with @ManagedAttribute and requires them to be valid Java bean accessors: a getter (isX/getX) or a setter (setX). When an annotated method is neither, it throws IllegalArgumentException naming the offending method and the managed class.
Source
Thrown at modules/flowable-jmx/src/main/java/org/flowable/management/jmx/MBeanInfoAssembler.java:187
continue;
}
LOGGER.trace("Extracting attributes and operations from method: {}", method);
ManagedAttribute ma = method.getAnnotation(ManagedAttribute.class);
if (ma != null) {
String key;
String desc = ma.description();
Method getter = null;
Method setter = null;
if (ReflectUtil.isGetter(method)) {
key = ReflectUtil.getGetterShorthandName(method);
getter = method;
} else if (ReflectUtil.isSetter(method)) {
key = ReflectUtil.getSetterShorthandName(method);
setter = method;
} else {
throw new IllegalArgumentException("@ManagedAttribute can only be used on Java bean methods, was: " + method + " on bean: " + managedClass);
}
// they key must be capitalized
key = capitalize(key);
// lookup first
ManagedAttributeInfo info = attributes.get(key);
if (info == null) {
info = new ManagedAttributeInfo(key, desc);
}
if (getter != null) {
info.setGetter(getter);
}
if (setter != null) {
info.setSetter(setter);
}
attributes.put(key, info);
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Rename the annotated method to follow bean conventions (getX/isX for getters, setX for setters)
- Ensure the getter has no parameters and a non-void return; ensure the setter takes exactly one parameter
- Remove @ManagedAttribute from methods that are not bean properties and use @ManagedOperation instead if applicable
- Check ReflectUtil.isGetter/isSetter expectations if using non-standard accessors
Example fix
// before
@ManagedAttribute
currentValue(Long v) { this.v = v; } // not a bean method
// after
@ManagedAttribute
public void setCurrentValue(Long v) { this.v = v; } Defensive patterns
Strategy: validation
Validate before calling
boolean isBeanAccessor(Method m) {
String n = m.getName();
boolean getter = (n.startsWith("get") && m.getParameterCount() == 0 && m.getReturnType() != void.class)
|| (n.startsWith("is") && m.getParameterCount() == 0 && (m.getReturnType() == boolean.class || m.getReturnType() == Boolean.class));
boolean setter = n.startsWith("set") && m.getParameterCount() == 1 && (m.getReturnType() == void.class || m.getReturnType() == m.getDeclaringClass());
return getter || setter;
}
// apply before annotating/processing: if (!isBeanAccessor(method)) throw ... Prevention
- Only annotate get/is/set style methods with @ManagedAttribute
- Getters must be no-arg with non-void return; setters one-arg
- Use @ManagedOperation for methods that are not properties
- Test JMX exposure of each managed bean at startup
When it happens
Trigger: Annotating a method with @ManagedAttribute when it has a non-bean signature (wrong parameter/return shape, name not matching get/is/set conventions) so ReflectUtil.isGetter/isSetter both return false.
Common situations: Typos in accessor names (e.g. fetchValue instead of getValue); getters with parameters; setters with no parameter or non-void return; annotating utility methods by mistake when exposing Flowable services via JMX.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- ${e.getMessage()}
- TypeConverter ${clazz} could not be instantiated
- Builder ${clazz} is missing constructor (can't pass features
- TreeBuilder ${clazz} could not be instantiated
- Could not get context class loader
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/e9d8c93324f235a1.
Report an issue: GitHub.