flowable/flowable-engine · error · ActivitiException

can't search values in configuration beans

Error message

can't search values in configuration beans

What it means

SpringBeanFactoryProxyMap only supports keyed bean lookups against a Spring BeanFactory; it cannot search values because beans are resolved lazily by name and there is no reverse index. containsValue(Object) is deliberately unimplemented and throws ActivitiException.

Source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cfg/SpringBeanFactoryProxyMap.java:64

        }
        return beanFactory.containsBean((String) key);
    }

    @Override
    public Set<Object> keySet() {
        throw new ActivitiException("unsupported operation on configuration beans");
        // List<String> beanNames = Arrays.asList(beanFactory.getBeanDefinitionNames());
        // return new HashSet<Object>(beanNames);
    }

    @Override
    public void clear() {
        throw new ActivitiException("can't clear configuration beans");
    }

    @Override
    public boolean containsValue(Object value) {
        throw new ActivitiException("can't search values in configuration beans");
    }

    @Override
    public Set<Map.Entry<Object, Object>> entrySet() {
        throw new ActivitiException("unsupported operation on configuration beans");
    }

    @Override
    public boolean isEmpty() {
        throw new ActivitiException("unsupported operation on configuration beans");
    }

    @Override
    public Object put(Object key, Object value) {
        throw new ActivitiException("unsupported operation on configuration beans");
    }

    @Override

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Remove the containsValue call; compare beans by name with get(name) instead
  2. If you hold the bean name, use containsKey(name) which is supported
  3. If value lookup is required, build a temporary map from getBeanDefinitionNames() and search that
  4. Refactor to query the ApplicationContext for beans of a type via getBeansOfType instead

Example fix

// before
boolean found = map.containsValue(myBean);
// after
boolean found = beanFactory.getBeanNamesForType(myBean.getClass()).length > 0;
Defensive patterns

Strategy: try-catch

Validate before calling

if (map instanceof SpringBeanFactoryProxyMap) {
    // value search unsupported: search by name via containsKey/get, or by type via getBeansOfType
}

Type guard

boolean isReadOnlyBeanMap = (map instanceof SpringBeanFactoryProxyMap);

Try / catch

try {
    boolean has = map.containsValue(bean);
} catch (ActivitiException e) {
    boolean has = applicationContext.getBeansOfType(bean.getClass()).containsValue(bean);
}

Prevention

When it happens

Trigger: Calling containsValue(value) on the map directly or through generic code that checks whether a map contains a value (deduplication logic, framework assertions, AbstractMap.equals-style helpers).

Common situations: Generic map comparison utilities; checking whether a bean instance is present by identity; code refactored from a HashMap config map to the Spring-backed map.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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