{"record":{"id":"21210a456f3b9ea4","repo":"flowable/flowable-engine","slug":"e-getmessage-21210a","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"JMException","httpStatus":null,"severity":"error","filePath":"modules/flowable-jmx/src/main/java/org/flowable/management/jmx/DefaultManagementMBeanAssembler.java","lineNumber":56,"sourceCode":"\r\n    @Override\r\n    public ModelMBean assemble(Object obj, ObjectName name) throws JMException {\r\n        ModelMBeanInfo mbi = null;\r\n\r\n        // use the default provided mbean which has been annotated with JMX annotations\r\n        LOGGER.trace(\"Assembling MBeanInfo for: {} from @ManagedResource object: {}\", name, obj);\r\n        mbi = assembler.getMBeanInfo(obj, null, name.toString());\r\n\r\n        if (mbi == null) {\r\n            return null;\r\n        }\r\n\r\n        RequiredModelMBean mbean = new RequiredModelMBean(mbi);\r\n\r\n        try {\r\n            mbean.setManagedResource(obj, \"ObjectReference\");\r\n        } catch (InvalidTargetObjectTypeException e) {\r\n            throw new JMException(e.getMessage());\r\n        }\r\n\r\n        // Allows the managed object to send notifications\r\n        if (obj instanceof NotificationSenderAware) {\r\n            ((NotificationSenderAware) obj).setNotificationSender(new NotificationSenderAdapter(mbean));\r\n        }\r\n\r\n        return mbean;\r\n    }\r\n\r\n}\r\n","sourceCodeStart":38,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-jmx/src/main/java/org/flowable/management/jmx/DefaultManagementMBeanAssembler.java#L38-L68","documentation":"DefaultManagementMBeanAssembler.assemble() builds a RequiredModelMBean and calls setManagedResource(obj, \"ObjectReference\"). The JMX API throws InvalidTargetObjectTypeException if the resource type string is not a supported value; this assembler translates it into a JMException, preserving the original message via e.getMessage().","triggerScenarios":"mbean.setManagedResource throwing InvalidTargetObjectTypeException during assemble(); this happens when the resource type string passed to setManagedResource is rejected by the MBean server implementation.","commonSituations":"Registering Flowable-managed objects as JMX MBeans where the underlying MBeanServer (or platform server) rejects the \"ObjectReference\" resource type; unusual JMX provider implementations or non-standard application servers.","solutions":["Inspect the JMException message (it carries the original InvalidTargetObjectTypeException text) to identify the rejected resource type","Verify the JMX provider/MBeanServer supports the \"ObjectReference\" resource type","Run on a standard platform MBean server (java.lang.management) rather than a custom one","Check application-server JMX configuration if deploying inside a container"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (obj == null) throw new IllegalArgumentException(\"managed resource must not be null\");\n// verify standard platform MBean server is in use\nMBeanServer server = ManagementFactory.getPlatformMBeanServer();","typeGuard":null,"tryCatchPattern":"try {\n    assembler.assemble(obj, mbeanInfo, name);\n} catch (JMException e) {\n    log.error(\"MBean assembly failed: \" + e.getMessage(), e);\n}","preventionTips":["Use the standard platform MBeanServer","Check the JMException message for the underlying InvalidTargetObjectTypeException detail","Avoid custom JMX providers unless tested with Flowable's JMX module","Validate the managed object before registration"],"tags":["jmx","mbean","flowable","reflection"],"backgroundTag":"invalid-argument-value","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"}