{"record":{"id":"4a881c5863a97bb3","repo":"flowable/flowable-engine","slug":"can-t-search-values-in-configuration-beans-4a881c","errorCode":null,"errorMessage":"can't search values in configuration beans","messagePattern":"can't search values in configuration beans","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cfg/SpringBeanFactoryProxyMap.java","lineNumber":64,"sourceCode":"        }\n        return beanFactory.containsBean((String) key);\n    }\n\n    @Override\n    public Set<Object> keySet() {\n        throw new ActivitiException(\"unsupported operation on configuration beans\");\n        // List<String> beanNames = Arrays.asList(beanFactory.getBeanDefinitionNames());\n        // return new HashSet<Object>(beanNames);\n    }\n\n    @Override\n    public void clear() {\n        throw new ActivitiException(\"can't clear configuration beans\");\n    }\n\n    @Override\n    public boolean containsValue(Object value) {\n        throw new ActivitiException(\"can't search values in configuration beans\");\n    }\n\n    @Override\n    public Set<Map.Entry<Object, Object>> entrySet() {\n        throw new ActivitiException(\"unsupported operation on configuration beans\");\n    }\n\n    @Override\n    public boolean isEmpty() {\n        throw new ActivitiException(\"unsupported operation on configuration beans\");\n    }\n\n    @Override\n    public Object put(Object key, Object value) {\n        throw new ActivitiException(\"unsupported operation on configuration beans\");\n    }\n\n    @Override","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cfg/SpringBeanFactoryProxyMap.java#L46-L82","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Remove the containsValue call; compare beans by name with get(name) instead","If you hold the bean name, use containsKey(name) which is supported","If value lookup is required, build a temporary map from getBeanDefinitionNames() and search that","Refactor to query the ApplicationContext for beans of a type via getBeansOfType instead"],"exampleFix":"// before\nboolean found = map.containsValue(myBean);\n// after\nboolean found = beanFactory.getBeanNamesForType(myBean.getClass()).length > 0;","handlingStrategy":"try-catch","validationCode":"if (map instanceof SpringBeanFactoryProxyMap) {\n    // value search unsupported: search by name via containsKey/get, or by type via getBeansOfType\n}","typeGuard":"boolean isReadOnlyBeanMap = (map instanceof SpringBeanFactoryProxyMap);","tryCatchPattern":"try {\n    boolean has = map.containsValue(bean);\n} catch (ActivitiException e) {\n    boolean has = applicationContext.getBeansOfType(bean.getClass()).containsValue(bean);\n}","preventionTips":["Locate beans by name (containsKey/get) or type (getBeansOfType), not by value identity","Avoid generic Map-equality/dedup helpers that call containsValue on this map","Remember the map is a lazy resolver — it has no reverse value index"],"tags":["spring","unsupported-operation","map"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}