{"record":{"id":"70bb47e2cec16254","repo":"flowable/flowable-engine","slug":"could-not-create-and-start-jmx-connector","errorCode":null,"errorMessage":"Could not create and start JMX connector.","messagePattern":"Could not create and start JMX connector\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-jmx/src/main/java/org/flowable/management/jmx/DefaultManagementAgent.java","lineNumber":156,"sourceCode":"    public void setMBeanServer(MBeanServer mbeanServer) {\r\n        this.server = mbeanServer;\r\n    }\r\n\r\n    @Override\r\n    public void doStart() {\r\n        createMBeanServer();\r\n    }\r\n\r\n    protected void createMBeanServer() {\r\n\r\n        server = findOrCreateMBeanServer();\r\n        try {\r\n            // Create the connector if we need\r\n            if (jmxConfigurator.getCreateConnector()) {\r\n                createJmxConnector(Utils.getHostName());\r\n            }\r\n        } catch (IOException ioe) {\r\n            LOGGER.warn(\"Could not create and start JMX connector.\", ioe);\r\n        }\r\n\r\n    }\r\n\r\n    protected MBeanServer findOrCreateMBeanServer() {\r\n\r\n        // look for the first mbean server that has match default domain name\r\n        if (jmxConfigurator.getMbeanDomain().equals(JMXConfigurator.DEFAUL_JMX_DOMAIN))\r\n            return ManagementFactory.getPlatformMBeanServer();\r\n\r\n        List<MBeanServer> servers = MBeanServerFactory.findMBeanServer(null);\r\n\r\n        for (MBeanServer server : servers) {\r\n            LOGGER.debug(\"Found MBeanServer with default domain {}\", server.getDefaultDomain());\r\n\r\n            if (jmxConfigurator.getMbeanDomain().equals(server.getDefaultDomain())) {\r\n                return server;\r\n            }\r","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-jmx/src/main/java/org/flowable/management/jmx/DefaultManagementAgent.java#L138-L174","documentation":"DefaultManagementAgent logs this WARN when createJmxConnector throws an IOException during createMBeanServer, i.e. the JMX connector server could not be created or bound. The MBean server itself still starts and MBeans are registered, but remote JMX clients cannot connect. Commonly a port conflict or network bind failure.","triggerScenarios":"doStart -> createMBeanServer -> createJmxConnector(hostname) throws IOException when opening the JMXConnectorServer: the configured JMX port is already in use, the address cannot be bound, or the connector URL is invalid for the environment.","commonSituations":"Another process (or a previous unterminated instance) already holds the JMX port; firewall/hostname resolution issues binding to the host name; containerized environments where the host name is not bindable; conflicting JMX configuration with the JVM's own JMX remote agent.","solutions":["Check with netstat/lsof whether the configured JMX port is taken and free it or change jmxConfigurator's connector port","Set a bindable host/port in the JMX configurator settings (e.g. localhost or 0.0.0.0)","Disable connector creation (createConnector=false) if remote JMX access is not needed","In containers/k8s, bind to an explicit interface instead of the machine hostname"],"exampleFix":"// before (implicit hostname binding fails in container)\ncreateJmxConnector(Utils.getHostName());\n// after (configure explicit host/port, or disable connector)\n// application flowable jmx createConnector=false","handlingStrategy":"try-catch","validationCode":"// check the JMX port is free before starting the agent\ntry (ServerSocket ss = new ServerSocket()) {\n    ss.bind(new InetSocketAddress(host, jmxPort));\n} catch (IOException e) {\n    // port in use: disable connector or pick another port before start\n}","typeGuard":null,"tryCatchPattern":"try {\n    managementAgent.start();\n} catch (Exception e) {\n    LOGGER.warn(\"Management agent failed to fully start (JMX connector may be unavailable): {}\", e.getMessage());\n}","preventionTips":["Reserve fixed, unique JMX ports per process/environment","Disable connector creation when only local MBean access is needed","In containers, bind JMX to an explicit address rather than hostname","Monitor for this WARN in startup logs and alert on it"],"tags":["jmx","port-conflict","network-bind"],"backgroundTag":"address-already-in-use","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"}