flowable/flowable-engine · error · ClassCastException

Unable to add an object of type '' to an array of objects…

Error message

Unable to add an object of type '' to an array of objects of type ''

What it means

Type guard in ArrayELResolver.setValue: the value being assigned to an array slot is not assignment-compatible with the array's component type (or cannot be coerced), so storing it would corrupt the array.

Solutions

  1. Assign a value of the array's component type (or a coercible one)
  2. Widen the array type or convert the value explicitly before assignment
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java:221 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/fce5bbb1e43caa76. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/javax/el/ArrayELResolver.java:221

	 */
	@Override
	public void setValue(ELContext context, Object base, Object property, Object value) {
		Objects.requireNonNull(context, "context is null");

		if (isResolvable(base)) {
			context.setPropertyResolved(base, property);

			if (LENGTH_PROPERTY_NAME.equals(property)) {
				throw new PropertyNotWritableException("Property '" + property + "' is not writable on '" + base.getClass().getName() + "'");
			}

			if (readOnly) {
				throw new PropertyNotWritableException("resolver is read-only");
			}
			int idx = coerce(property);
			checkBounds(base, idx);
			if (value != null && !Util.isAssignableFrom(value.getClass(), base.getClass().getComponentType())) {
				throw new ClassCastException(
						"Unable to add an object of type '" + value.getClass().getName() + "' to an array of objects of type '" + base.getClass()
								.getComponentType().getName() + "'");
			}
			Array.set(base, idx, value);
		}
	}

	/**
	 * If the base object is a Java language array, returns whether a call to {@link #setValue} will always fail.
	 *
	 * <p>
	 * If the base is a Java language array, the <code>propertyResolved</code> property of the <code>ELContext</code> object
	 * must be set to <code>true</code> by this resolver, before returning. If this property is not <code>true</code> after
	 * this method is called, the caller should ignore the return value.
	 * </p>
	 *
	 * <p>
	 * If this resolver was constructed in read-only mode or the property is the case sensitive string {@code length},

View on GitHub (pinned to d6d39ce1c6)