VYPR
High severityNVD Advisory· Published May 14, 2020· Updated Aug 4, 2024

CVE-2020-11971

CVE-2020-11971

Description

Apache Camel's JMX is vulnerable to Rebind Flaw. Apache Camel 2.22.x, 2.23.x, 2.24.x, 2.25.x, 3.0.0 up to 3.1.0 is affected. Users should upgrade to 3.2.0.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Apache Camel's JMX component is vulnerable to a Rebind Flaw that can allow an attacker to execute arbitrary code via JMX rebind attacks.

# Vulnerability Analysis

CVE-2020-11971 is a vulnerability in the Apache Camel integration framework that arises from insecure default JMX connector configuration. In vulnerable versions (2.22.x, 2.23.x, 2.24.x, 2.25.x, 3.0.0 up to 3.1.0), Camel creates its own JMX RMI registry with default ports (1099 for the registry, -1 for the connector) and publishes a JMX connector via the platform MBeanServer. The root cause is that this custom JMX configuration is susceptible to a "Rebind Flaw" — an attacker in the same network can rebind the RMI registry, intercept or spoof JMX interactions, and potentially execute arbitrary code on the target system.

Attack

Vector and Prerequisites The attack requires network access to the affected Camel application's RMI registry port (typically port 1099). No authentication is needed to interact with the registry because it uses default, unsecured settings. An attacker can perform an RMI rebind attack by registering a rogue MBean that replaces a legitimate one, or by redirecting the JMX client to a malicious RMI registry. This exploits the default JMX connector configuration that was created by Camel itself rather than relying on the Java Virtual Machine’s built-in (more secure) JMX settings [1][2].

Impact

Successful exploitation allows an attacker to execute arbitrary Java code on the Camel server with the same privileges as the Camel application. This can lead to full compromise of the application and the host system, including data exfiltration, lateral movement, or further attacks within the network. The vulnerability is classified as Critical with a CVSS v3 score of 9.8, indicating high severity due to the ease of exploitation and the potential for remote code execution [1].

Mitigation

The Apache Camel project has issued a fix for version 3.2.0 by removing the custom JMX connector configuration entirely [2][4]. The commit (b954402) deletes the registryPort and connectorPort properties, effectively disabling the custom JMX connector and causing Camel to use the default JVM JMX settings, which are more secure and not vulnerable to this rebind flaw. Users of affected versions (2.22.x through 3.1.0) should upgrade to Apache Camel 3.2.0 or later immediately. No workaround is available, as disabling JMX would degrade functionality and the vulnerable configuration is enabled by default [1].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.apache.camel:camelMaven
< 3.2.03.2.0
org.apache.camel:camel-coreMaven
< 3.2.03.2.0
org.apache.camel:camel-managementMaven
< 3.2.03.2.0

Affected products

6

Patches

1
b954402272dd

CAMEL-14811 - Remove JMX Connector configuration

https://github.com/apache/camelColm O hEigeartaighMar 30, 2020via ghsa
25 files changed · +29 791
  • components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java+2 7 modified
    @@ -25,12 +25,7 @@
     /**
      * Test that verifies JMX properties can be configured via Spring.
      */
    -public class JMXAgentPropertiesTest extends JMXAgentTest {
    -
    -    @Override
    -    protected int getPort() {
    -        return 20009;
    -    }
    +public class JMXAgentPropertiesTest extends DefaultJMXAgentTest {
     
         @Override
         protected AbstractXmlApplicationContext createApplicationContext() {
    @@ -45,4 +40,4 @@ public void testEnableUseHostIPAddress() throws Exception {
             assertTrue(agent.getUseHostIPAddress());
         }
     
    -}
    \ No newline at end of file
    +}
    
  • components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java+0 70 removed
    @@ -1,70 +0,0 @@
    -/*
    - * Licensed to the Apache Software Foundation (ASF) under one or more
    - * contributor license agreements.  See the NOTICE file distributed with
    - * this work for additional information regarding copyright ownership.
    - * The ASF licenses this file to You under the Apache License, Version 2.0
    - * (the "License"); you may not use this file except in compliance with
    - * the License.  You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package org.apache.camel.spring;
    -
    -import javax.management.MBeanServerConnection;
    -import javax.management.remote.JMXConnector;
    -import javax.management.remote.JMXConnectorFactory;
    -import javax.management.remote.JMXServiceURL;
    -
    -import org.junit.After;
    -import org.springframework.context.support.AbstractXmlApplicationContext;
    -import org.springframework.context.support.ClassPathXmlApplicationContext;
    -
    -/**
    - * Test that verifies JMX properties can be configured via Spring.
    - */
    -public class JMXAgentTest extends DefaultJMXAgentTest {
    -
    -    protected final String jmxServiceUrl = "service:jmx:rmi:///jndi/rmi://localhost:" + getPort() + "/jmxrmi/camel";
    -    protected JMXConnector clientConnector;
    -
    -    protected int getPort() {
    -        return 20008;
    -    }
    -
    -    @Override
    -    @After
    -    public void tearDown() throws Exception {
    -        if (clientConnector != null) {
    -            try {
    -                clientConnector.close();
    -            } catch (Exception e) {
    -                // ignore
    -            }
    -            clientConnector = null;
    -        }
    -        super.tearDown();
    -    }
    -
    -    @Override
    -    protected AbstractXmlApplicationContext createApplicationContext() {
    -        return new ClassPathXmlApplicationContext("org/apache/camel/spring/jmxConfig.xml");
    -    }
    -
    -    @Override
    -    protected MBeanServerConnection getMBeanConnection() throws Exception {
    -        if (mbsc == null) {
    -            if (clientConnector == null) {
    -                clientConnector = JMXConnectorFactory.connect(new JMXServiceURL(jmxServiceUrl), null);
    -            }
    -            mbsc = clientConnector.getMBeanServerConnection();
    -        }
    -        return mbsc;
    -    }
    -
    -}
    
  • components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml+1 2 modified
    @@ -29,9 +29,8 @@
             <propertyPlaceholder id="properties" location="org/apache/camel/spring/jmx.properties"/>
     
             <!-- we can use propery placeholders when we define the JMX agent -->
    -        <jmxAgent id="agent" registryPort="{{myjmx.port}}" disabled="{{myjmx.disabled}}"
    +        <jmxAgent id="agent" disabled="{{myjmx.disabled}}"
                       usePlatformMBeanServer="{{myjmx.usePlatform}}"
    -                  createConnector="true"
                       statisticsLevel="RoutesOnly"
                       useHostIPAddress="true"/>
     
    
  • components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfig.xml+0 43 removed
    @@ -1,43 +0,0 @@
    -<?xml version="1.0" encoding="UTF-8"?>
    -<!--
    -
    -    Licensed to the Apache Software Foundation (ASF) under one or more
    -    contributor license agreements.  See the NOTICE file distributed with
    -    this work for additional information regarding copyright ownership.
    -    The ASF licenses this file to You under the Apache License, Version 2.0
    -    (the "License"); you may not use this file except in compliance with
    -    the License.  You may obtain a copy of the License at
    -
    -         http://www.apache.org/licenses/LICENSE-2.0
    -
    -    Unless required by applicable law or agreed to in writing, software
    -    distributed under the License is distributed on an "AS IS" BASIS,
    -    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -    See the License for the specific language governing permissions and
    -    limitations under the License.
    -
    --->
    -<beans xmlns="http://www.springframework.org/schema/beans"
    -       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    -       xsi:schemaLocation="
    -       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    -       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    -    ">
    -
    -    <!-- START SNIPPET: example -->
    -    <camelContext xmlns="http://camel.apache.org/schema/spring">
    -        <!-- enable JMX -->
    -        <jmxAgent id="agent" registryPort="20008"
    -                  usePlatformMBeanServer="true"
    -                  createConnector="true"
    -                  />
    -
    -        <route id="foo" autoStartup="false">
    -            <from uri="seda:start"/>
    -            <to uri="mock:result"/>
    -        </route>
    -
    -    </camelContext>
    -    <!-- END SNIPPET: example -->
    -
    -</beans>
    
  • core/camel-api/src/main/java/org/apache/camel/spi/ManagementAgent.java+8 64 modified
    @@ -29,17 +29,17 @@
     public interface ManagementAgent extends Service {
     
         /**
    -     * Registers object with management infrastructure with a specific name. Object must be annotated or 
    +     * Registers object with management infrastructure with a specific name. Object must be annotated or
          * implement standard MBean interface.
          *
          * @param obj  the object to register
          * @param name the name
          * @throws JMException is thrown if the registration failed
          */
         void register(Object obj, ObjectName name) throws JMException;
    -    
    +
         /**
    -     * Registers object with management infrastructure with a specific name. Object must be annotated or 
    +     * Registers object with management infrastructure with a specific name. Object must be annotated or
          * implement standard MBean interface.
          *
          * @param obj  the object to register
    @@ -49,7 +49,7 @@ public interface ManagementAgent extends Service {
          * @throws JMException is thrown if the registration failed
          */
         void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException;
    -    
    +
         /**
          * Unregisters object based upon registered name
          *
    @@ -80,7 +80,7 @@ public interface ManagementAgent extends Service {
          * <p/>
          * <b>Notice:</b> If the JMXEnabled configuration is not set to <tt>true</tt>,
          * this method will return <tt>null</tt>.
    -     * 
    +     *
          * @return the MBeanServer
          */
         MBeanServer getMBeanServer();
    @@ -96,39 +96,11 @@ public interface ManagementAgent extends Service {
          * Get domain name for Camel MBeans.
          * <p/>
          * <b>Notice:</b> That this can be different that the default domain name of the MBean Server.
    -     * 
    +     *
          * @return domain name
          */
         String getMBeanObjectDomainName();
     
    -    /**
    -     * Sets the port used by {@link java.rmi.registry.LocateRegistry}.
    -     *
    -     * @param port the port
    -     */
    -    void setRegistryPort(Integer port);
    -
    -    /**
    -     * Gets the port used by {@link java.rmi.registry.LocateRegistry}.
    -     *
    -     * @return the port
    -     */
    -    Integer getRegistryPort();
    -
    -    /**
    -     * Sets the port clients must use to connect
    -     *
    -     * @param port the port
    -     */
    -    void setConnectorPort(Integer port);
    -
    -    /**
    -     * Gets the port clients must use to connect
    -     *
    -     * @return the port
    -     */
    -    Integer getConnectorPort();
    -
         /**
          * Sets the default domain on the MBean server
          *
    @@ -150,34 +122,6 @@ public interface ManagementAgent extends Service {
          */
         void setMBeanObjectDomainName(String domainName);
     
    -    /**
    -     * Sets the service url
    -     *
    -     * @param url the service url
    -     */
    -    void setServiceUrlPath(String url);
    -
    -    /**
    -     * Gets the service url
    -     *
    -     * @return the url
    -     */
    -    String getServiceUrlPath();
    -
    -    /**
    -     * Whether connector should be created, allowing clients to connect remotely
    -     *
    -     * @param createConnector <tt>true</tt> to create connector
    -     */
    -    void setCreateConnector(Boolean createConnector);
    -
    -    /**
    -     * Whether connector is created, allowing clients to connect remotely
    -     *
    -     * @return <tt>true</tt> if connector is created
    -     */
    -    Boolean getCreateConnector();
    -
         /**
          * Whether to use the platform MBean Server.
          *
    @@ -351,7 +295,7 @@ public interface ManagementAgent extends Service {
          * @return the level
          */
         ManagementStatisticsLevel getStatisticsLevel();
    -    
    +
         /**
          * Gets whether host IP Address to be used instead of host name.
          *
    @@ -360,7 +304,7 @@ public interface ManagementAgent extends Service {
         Boolean getUseHostIPAddress();
     
         /**
    -     * Sets whether to use host IP Address 
    +     * Sets whether to use host IP Address
          * @param useHostIPAddress <tt>true</tt> to use IP Address.
          */
         void setUseHostIPAddress(Boolean useHostIPAddress);
    
  • core/camel-core-xml/src/generated/resources/org/apache/camel/core/xml/jmxAgent.json+0 4 modified
    @@ -13,12 +13,8 @@
       "properties": {
         "disabled": { "kind": "attribute", "displayName": "Disabled", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Disable JMI (default false)" },
         "onlyRegisterProcessorWithCustomId": { "kind": "attribute", "displayName": "Only Register Processor With Custom Id", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Only register processor if a custom id was defined for it." },
    -    "registryPort": { "kind": "attribute", "displayName": "Registry Port", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "1099", "description": "RMI connector registry port (default 1099)" },
    -    "connectorPort": { "kind": "attribute", "displayName": "Connector Port", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "-1", "description": "RMI connector server port (default -1 not used)" },
         "mbeanServerDefaultDomain": { "kind": "attribute", "displayName": "Mbean Server Default Domain", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "org.apache.camel", "description": "MBean server default domain name (default org.apache.camel)" },
         "mbeanObjectDomainName": { "kind": "attribute", "displayName": "Mbean Object Domain Name", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "org.apache.camel", "description": "MBean object domain name (default org.apache.camel)" },
    -    "serviceUrlPath": { "kind": "attribute", "displayName": "Service Url Path", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "\/jmxrmi", "description": "JMX Service URL path (default \/jmxrmi)" },
    -    "createConnector": { "kind": "attribute", "displayName": "Create Connector", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "false", "description": "A flag that indicates whether the agent should be created" },
         "usePlatformMBeanServer": { "kind": "attribute", "displayName": "Use Platform MBean Server", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "true", "description": "A flag that indicates whether the platform mbean server should be used" },
         "registerAlways": { "kind": "attribute", "displayName": "Register Always", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "false", "description": "A flag that indicates whether to register mbeans always" },
         "registerNewRoutes": { "kind": "attribute", "displayName": "Register New Routes", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "false", "description": "A flag that indicates whether to register mbeans when starting new routes" },
    
  • core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java+0 12 modified
    @@ -552,21 +552,9 @@ protected void initJMXAgent() throws Exception {
                 LOG.info("JMXAgent enabled: {}", camelJMXAgent);
     
                 Map<String, Object> properties = new HashMap<>();
    -            if (camelJMXAgent.getConnectorPort() != null) {
    -                properties.put("connectorPort", CamelContextHelper.parseInteger(getContext(), camelJMXAgent.getConnectorPort()));
    -            }
    -            if (camelJMXAgent.getCreateConnector() != null) {
    -                properties.put("createConnector", CamelContextHelper.parseBoolean(getContext(), camelJMXAgent.getCreateConnector()));
    -            }
                 if (camelJMXAgent.getMbeanObjectDomainName() != null) {
                     properties.put("mbeanObjectDomainName", CamelContextHelper.parseText(getContext(), camelJMXAgent.getMbeanObjectDomainName()));
                 }
    -            if (camelJMXAgent.getRegistryPort() != null) {
    -                properties.put("registryPort", CamelContextHelper.parseInteger(getContext(), camelJMXAgent.getRegistryPort()));
    -            }
    -            if (camelJMXAgent.getServiceUrlPath() != null) {
    -                properties.put("serviceUrlPath", CamelContextHelper.parseText(getContext(), camelJMXAgent.getServiceUrlPath()));
    -            }
                 if (camelJMXAgent.getUsePlatformMBeanServer() != null) {
                     properties.put("usePlatformMBeanServer", CamelContextHelper.parseBoolean(getContext(), camelJMXAgent.getUsePlatformMBeanServer()));
                 }
    
  • core/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java+0 64 modified
    @@ -37,18 +37,10 @@ public class CamelJMXAgentDefinition extends IdentifiedType {
         private String disabled;
         @XmlAttribute @Metadata(defaultValue = "false")
         private String onlyRegisterProcessorWithCustomId;
    -    @XmlAttribute @Metadata(defaultValue = "1099")
    -    private String registryPort;
    -    @XmlAttribute @Metadata(defaultValue = "-1")
    -    private String connectorPort;
         @XmlAttribute @Metadata(defaultValue = "org.apache.camel")
         private String mbeanServerDefaultDomain;
         @XmlAttribute @Metadata(defaultValue = "org.apache.camel")
         private String mbeanObjectDomainName;
    -    @XmlAttribute @Metadata(defaultValue = "/jmxrmi")
    -    private String serviceUrlPath;
    -    @XmlAttribute @Metadata(defaultValue = "false")
    -    private String createConnector;
         @XmlAttribute @Metadata(defaultValue = "true")
         private String usePlatformMBeanServer;
         @XmlAttribute @Metadata(defaultValue = "false")
    @@ -90,28 +82,6 @@ public void setOnlyRegisterProcessorWithCustomId(String onlyRegisterProcessorWit
             this.onlyRegisterProcessorWithCustomId = onlyRegisterProcessorWithCustomId;
         }
     
    -    public String getRegistryPort() {
    -        return registryPort;
    -    }
    -
    -    /**
    -     * RMI connector registry port (default 1099)
    -     */
    -    public void setRegistryPort(String registryPort) {
    -        this.registryPort = registryPort;
    -    }
    -
    -    public String getConnectorPort() {
    -        return connectorPort;
    -    }
    -
    -    /**
    -     * RMI connector server port (default -1 not used)
    -     */
    -    public void setConnectorPort(String connectorPort) {
    -        this.connectorPort = connectorPort;
    -    }
    -
         public String getMbeanServerDefaultDomain() {
             return mbeanServerDefaultDomain;
         }
    @@ -134,28 +104,6 @@ public void setMbeanObjectDomainName(String mbeanObjectDomainName) {
             this.mbeanObjectDomainName = mbeanObjectDomainName;
         }
     
    -    public String getServiceUrlPath() {
    -        return serviceUrlPath;
    -    }
    -
    -    /**
    -     * JMX Service URL path (default /jmxrmi)
    -     */
    -    public void setServiceUrlPath(String serviceUrlPath) {
    -        this.serviceUrlPath = serviceUrlPath;
    -    }
    -
    -    public String getCreateConnector() {
    -        return createConnector;
    -    }
    -
    -    /**
    -     * A flag that indicates whether the agent should be created
    -     */
    -    public void setCreateConnector(String createConnector) {
    -        this.createConnector = createConnector;
    -    }
    -
         public String getUsePlatformMBeanServer() {
             return usePlatformMBeanServer;
         }
    @@ -267,18 +215,6 @@ public String toString() {
             if (usePlatformMBeanServer != null) {
                 csb.append("usePlatformMBeanServer=" + usePlatformMBeanServer);
             }
    -        if (createConnector != null) {
    -            csb.append("createConnector=" + createConnector);
    -        }
    -        if (connectorPort != null) {
    -            csb.append("connectorPort=" + connectorPort);
    -        }
    -        if (registryPort != null) {
    -            csb.append("registryPort=" + registryPort);
    -        }
    -        if (serviceUrlPath != null) {
    -            csb.append("serviceUrlPath=" + serviceUrlPath);
    -        }
             if (mbeanServerDefaultDomain != null) {
                 csb.append("mbeanServerDefaultDomain=" + mbeanServerDefaultDomain);
             }
    
  • core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java+0 2 modified
    @@ -71,8 +71,6 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
             case "JavaRoutesExcludePattern": target.setJavaRoutesExcludePattern(property(camelContext, java.lang.String.class, value)); return true;
             case "javaroutesincludepattern":
             case "JavaRoutesIncludePattern": target.setJavaRoutesIncludePattern(property(camelContext, java.lang.String.class, value)); return true;
    -        case "jmxcreateconnector":
    -        case "JmxCreateConnector": target.setJmxCreateConnector(property(camelContext, boolean.class, value)); return true;
             case "jmxenabled":
             case "JmxEnabled": target.setJmxEnabled(property(camelContext, boolean.class, value)); return true;
             case "jmxmanagementnamepattern":
    
  • core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json+0 1 modified
    @@ -34,7 +34,6 @@
         { "name": "camel.main.inflightRepositoryBrowseEnabled", "description": "Sets whether the inflight repository should allow browsing each inflight exchange. This is by default disabled as there is a very slight performance overhead when enabled.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
         { "name": "camel.main.javaRoutesExcludePattern", "description": "Used for exclusive filtering component scanning of RouteBuilder classes with Component annotation. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to exclude all classes starting with Bar use: &#42;&#42;\/Bar&#42; To exclude all routes form a specific package use: com\/mycompany\/bar\/&#42; To exclude all routes form a specific package and its sub-packages use double wildcards: com\/mycompany\/bar\/&#42;&#42; And to exclude all routes from two specific packages use: com\/mycompany\/bar\/&#42;,com\/mycompany\/stuff\/&#42;", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
         { "name": "camel.main.javaRoutesIncludePattern", "description": "Used for inclusive filtering component scanning of RouteBuilder classes with Component annotation. The exclusive filtering takes precedence over inclusive filtering. The pattern is using Ant-path style pattern. Multiple patterns can be specified separated by comma. For example to include all classes starting with Foo use: &#42;&#42;\/Foo To include all routes form a specific package use: com\/mycompany\/foo\/&#42; To include all routes form a specific package and its sub-packages use double wildcards: com\/mycompany\/foo\/&#42;&#42; And to include all routes from two specific packages use: com\/mycompany\/foo\/&#42;,com\/mycompany\/stuff\/&#42;", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
    -    { "name": "camel.main.jmxCreateConnector", "description": "Whether JMX connector is created, allowing clients to connect remotely The default value is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
         { "name": "camel.main.jmxEnabled", "description": "Enable JMX in your Camel application.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
         { "name": "camel.main.jmxManagementNamePattern", "description": "The naming pattern for creating the CamelContext JMX management name. The default pattern is #name#", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "#name#" },
         { "name": "camel.main.jmxManagementStatisticsLevel", "description": "Sets the JMX statistics level The level can be set to Extended to gather additional information The default value is Default.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "object", "javaType": "org.apache.camel.ManagementStatisticsLevel", "defaultValue": "ManagementStatisticsLevel.Default", "enum": [ "Extended", "Default", "RoutesOnly", "Off" ] },
    
  • core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java+0 1 modified
    @@ -158,7 +158,6 @@ public static void configure(CamelContext camelContext, DefaultConfigurationProp
                 camelContext.getManagementStrategy().getManagementAgent().setEndpointRuntimeStatisticsEnabled(config.isEndpointRuntimeStatisticsEnabled());
                 camelContext.getManagementStrategy().getManagementAgent().setStatisticsLevel(config.getJmxManagementStatisticsLevel());
                 camelContext.getManagementStrategy().getManagementAgent().setManagementNamePattern(config.getJmxManagementNamePattern());
    -            camelContext.getManagementStrategy().getManagementAgent().setCreateConnector(config.isJmxCreateConnector());
             }
     
             // global endpoint configurations
    
  • core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java+0 24 modified
    @@ -68,7 +68,6 @@ public abstract class DefaultConfigurationProperties<T> {
         private boolean useBreadcrumb;
         private ManagementStatisticsLevel jmxManagementStatisticsLevel = ManagementStatisticsLevel.Default;
         private String jmxManagementNamePattern = "#name#";
    -    private boolean jmxCreateConnector;
         private boolean useMdcLogging;
         private String mdcLoggingKeysPattern;
         private String threadNamePattern;
    @@ -660,19 +659,6 @@ public void setJmxManagementNamePattern(String jmxManagementNamePattern) {
             this.jmxManagementNamePattern = jmxManagementNamePattern;
         }
     
    -    public boolean isJmxCreateConnector() {
    -        return jmxCreateConnector;
    -    }
    -
    -    /**
    -     * Whether JMX connector is created, allowing clients to connect remotely
    -     *
    -     * The default value is false.
    -     */
    -    public void setJmxCreateConnector(boolean jmxCreateConnector) {
    -        this.jmxCreateConnector = jmxCreateConnector;
    -    }
    -
         public boolean isUseMdcLogging() {
             return useMdcLogging;
         }
    @@ -1341,16 +1327,6 @@ public T withJmxManagementNamePattern(String jmxManagementNamePattern) {
             return (T) this;
         }
     
    -    /**
    -     * Whether JMX connector is created, allowing clients to connect remotely
    -     *
    -     * The default value is false.
    -     */
    -    public T withJmxCreateConnector(boolean jmxCreateConnector) {
    -        this.jmxCreateConnector = jmxCreateConnector;
    -        return (T) this;
    -    }
    -
         /**
          * To turn on MDC logging
          */
    
  • core/camel-management-api/src/main/java/org/apache/camel/api/management/JmxSystemPropertyKeys.java+0 12 modified
    @@ -24,24 +24,12 @@ public final class JmxSystemPropertyKeys {
         // disable jmx
         public static final String DISABLED = "org.apache.camel.jmx.disabled";
     
    -    // jmx (rmi registry) port
    -    public static final String REGISTRY_PORT = "org.apache.camel.jmx.rmiConnector.registryPort";
    -    
    -    // jmx (rmi server connection) port
    -    public static final String CONNECTOR_PORT = "org.apache.camel.jmx.rmiConnector.connectorPort";
    -
         // jmx domain name
         public static final String DOMAIN = "org.apache.camel.jmx.mbeanServerDefaultDomain";
         
         // the domain name for the camel mbeans
         public static final String MBEAN_DOMAIN = "org.apache.camel.jmx.mbeanObjectDomainName";
     
    -    // JMX service URL path 
    -    public static final String SERVICE_URL_PATH = "org.apache.camel.jmx.serviceUrlPath";
    -    
    -    // A flag that indicates whether the agent should be created
    -    public static final String CREATE_CONNECTOR = "org.apache.camel.jmx.createRmiConnector";
    -    
         // use jvm platform mbean server flag
         public static final String USE_PLATFORM_MBS = "org.apache.camel.jmx.usePlatformMBeanServer";
     
    
  • core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementAgent.java+1 179 modified
    @@ -18,13 +18,6 @@
     
     import java.io.IOException;
     import java.lang.management.ManagementFactory;
    -import java.net.InetAddress;
    -import java.net.UnknownHostException;
    -import java.rmi.NoSuchObjectException;
    -import java.rmi.RemoteException;
    -import java.rmi.registry.LocateRegistry;
    -import java.rmi.registry.Registry;
    -import java.rmi.server.UnicastRemoteObject;
     import java.util.LinkedHashMap;
     import java.util.List;
     import java.util.Map;
    @@ -38,9 +31,6 @@
     import javax.management.NotCompliantMBeanException;
     import javax.management.ObjectInstance;
     import javax.management.ObjectName;
    -import javax.management.remote.JMXConnectorServer;
    -import javax.management.remote.JMXConnectorServerFactory;
    -import javax.management.remote.JMXServiceURL;
     
     import org.apache.camel.CamelContext;
     import org.apache.camel.CamelContextAware;
    @@ -52,9 +42,7 @@
     import org.apache.camel.support.management.DefaultManagementMBeanAssembler;
     import org.apache.camel.support.service.ServiceHelper;
     import org.apache.camel.support.service.ServiceSupport;
    -import org.apache.camel.util.InetAddressUtil;
     import org.apache.camel.util.ObjectHelper;
    -import org.apache.camel.util.StringHelper;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
    @@ -65,9 +53,6 @@ public class DefaultManagementAgent extends ServiceSupport implements Management
     
         public static final String DEFAULT_DOMAIN = "org.apache.camel";
         public static final String DEFAULT_HOST = "localhost";
    -    public static final int DEFAULT_REGISTRY_PORT = 1099;
    -    public static final int DEFAULT_CONNECTION_PORT = -1;
    -    public static final String DEFAULT_SERVICE_URL_PATH = "/jmxrmi/camel";
         private static final Logger LOG = LoggerFactory.getLogger(DefaultManagementAgent.class);
     
         private CamelContext camelContext;
    @@ -76,16 +61,10 @@ public class DefaultManagementAgent extends ServiceSupport implements Management
     
         // need a name -> actual name mapping as some servers changes the names (such as WebSphere)
         private final ConcurrentMap<ObjectName, ObjectName> mbeansRegistered = new ConcurrentHashMap<>();
    -    private JMXConnectorServer cs;
    -    private Registry registry;
     
    -    private Integer registryPort = DEFAULT_REGISTRY_PORT;
    -    private Integer connectorPort = DEFAULT_CONNECTION_PORT;
         private String mBeanServerDefaultDomain = DEFAULT_DOMAIN;
         private String mBeanObjectDomainName = DEFAULT_DOMAIN;
    -    private String serviceUrlPath = DEFAULT_SERVICE_URL_PATH;
         private Boolean usePlatformMBeanServer = true;
    -    private Boolean createConnector = false;
         private Boolean onlyRegisterProcessorWithCustomId = false;
         private Boolean loadStatisticsEnabled = false;
         private Boolean endpointRuntimeStatisticsEnabled;
    @@ -108,14 +87,6 @@ protected void finalizeSettings() throws Exception {
             // JVM system properties take precedence over any configuration
             Map<String, Object> values = new LinkedHashMap<>();
     
    -        if (System.getProperty(JmxSystemPropertyKeys.REGISTRY_PORT) != null) {
    -            registryPort = Integer.getInteger(JmxSystemPropertyKeys.REGISTRY_PORT);
    -            values.put(JmxSystemPropertyKeys.REGISTRY_PORT, registryPort);
    -        }
    -        if (System.getProperty(JmxSystemPropertyKeys.CONNECTOR_PORT) != null) {
    -            connectorPort = Integer.getInteger(JmxSystemPropertyKeys.CONNECTOR_PORT);
    -            values.put(JmxSystemPropertyKeys.CONNECTOR_PORT, connectorPort);
    -        }
             if (System.getProperty(JmxSystemPropertyKeys.DOMAIN) != null) {
                 mBeanServerDefaultDomain = System.getProperty(JmxSystemPropertyKeys.DOMAIN);
                 values.put(JmxSystemPropertyKeys.DOMAIN, mBeanServerDefaultDomain);
    @@ -124,14 +95,6 @@ protected void finalizeSettings() throws Exception {
                 mBeanObjectDomainName = System.getProperty(JmxSystemPropertyKeys.MBEAN_DOMAIN);
                 values.put(JmxSystemPropertyKeys.MBEAN_DOMAIN, mBeanObjectDomainName);
             }
    -        if (System.getProperty(JmxSystemPropertyKeys.SERVICE_URL_PATH) != null) {
    -            serviceUrlPath = System.getProperty(JmxSystemPropertyKeys.SERVICE_URL_PATH);
    -            values.put(JmxSystemPropertyKeys.SERVICE_URL_PATH, serviceUrlPath);
    -        }
    -        if (System.getProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR) != null) {
    -            createConnector = Boolean.getBoolean(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    -            values.put(JmxSystemPropertyKeys.CREATE_CONNECTOR, createConnector);
    -        }
             if (System.getProperty(JmxSystemPropertyKeys.ONLY_REGISTER_PROCESSOR_WITH_CUSTOM_ID) != null) {
                 onlyRegisterProcessorWithCustomId = Boolean.getBoolean(JmxSystemPropertyKeys.ONLY_REGISTER_PROCESSOR_WITH_CUSTOM_ID);
                 values.put(JmxSystemPropertyKeys.ONLY_REGISTER_PROCESSOR_WITH_CUSTOM_ID, onlyRegisterProcessorWithCustomId);
    @@ -156,10 +119,6 @@ protected void finalizeSettings() throws Exception {
                 includeHostName = Boolean.getBoolean(JmxSystemPropertyKeys.INCLUDE_HOST_NAME);
                 values.put(JmxSystemPropertyKeys.INCLUDE_HOST_NAME, includeHostName);
             }
    -        if (System.getProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR) != null) {
    -            createConnector = Boolean.getBoolean(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    -            values.put(JmxSystemPropertyKeys.CREATE_CONNECTOR, createConnector);
    -        }
             if (System.getProperty(JmxSystemPropertyKeys.LOAD_STATISTICS_ENABLED) != null) {
                 loadStatisticsEnabled = Boolean.getBoolean(JmxSystemPropertyKeys.LOAD_STATISTICS_ENABLED);
                 values.put(JmxSystemPropertyKeys.LOAD_STATISTICS_ENABLED, loadStatisticsEnabled);
    @@ -186,26 +145,6 @@ protected void finalizeSettings() throws Exception {
             }
         }
     
    -    @Override
    -    public void setRegistryPort(Integer port) {
    -        registryPort = port;
    -    }
    -
    -    @Override
    -    public Integer getRegistryPort() {
    -        return registryPort;
    -    }
    -
    -    @Override
    -    public void setConnectorPort(Integer port) {
    -        connectorPort = port;
    -    }
    -
    -    @Override
    -    public Integer getConnectorPort() {
    -        return connectorPort;
    -    }
    -
         @Override
         public void setMBeanServerDefaultDomain(String domain) {
             mBeanServerDefaultDomain = domain;
    @@ -226,26 +165,6 @@ public String getMBeanObjectDomainName() {
             return mBeanObjectDomainName;
         }
     
    -    @Override
    -    public void setServiceUrlPath(String url) {
    -        serviceUrlPath = url;
    -    }
    -
    -    @Override
    -    public String getServiceUrlPath() {
    -        return serviceUrlPath;
    -    }
    -
    -    @Override
    -    public void setCreateConnector(Boolean flag) {
    -        createConnector = flag;
    -    }
    -
    -    @Override
    -    public Boolean getCreateConnector() {
    -        return createConnector;
    -    }
    -
         @Override
         public void setUsePlatformMBeanServer(Boolean flag) {
             usePlatformMBeanServer = flag;
    @@ -455,28 +374,6 @@ protected void doStart() throws Exception {
     
         @Override
         protected void doStop() throws Exception {
    -        // close JMX Connector, if it was created
    -        if (cs != null) {
    -            try {
    -                cs.stop();
    -                LOG.debug("Stopped JMX Connector");
    -            } catch (IOException e) {
    -                LOG.debug("Error occurred during stopping JMXConnectorService: "
    -                        + cs + ". This exception will be ignored.");
    -            }
    -            cs = null;
    -        }
    -
    -        // Unexport JMX RMI registry, if it was created
    -        if (registry != null) {
    -            try {
    -                UnicastRemoteObject.unexportObject(registry, true);
    -                LOG.debug("Unexported JMX RMI Registry");
    -            } catch (NoSuchObjectException e) {
    -                LOG.debug("Error occurred while unexporting JMX RMI registry. This exception will be ignored.");
    -            }
    -        }
    -
             if (mbeansRegistered.isEmpty()) {
                 return;
             }
    @@ -532,45 +429,9 @@ private void registerMBeanWithServer(Object obj, ObjectName name, boolean forceR
         }
     
         protected void createMBeanServer() {
    -        String hostName;
    -        boolean canAccessSystemProps = true;
    -        try {
    -            // we'll do it this way mostly to determine if we should lookup the hostName
    -            SecurityManager sm = System.getSecurityManager();
    -            if (sm != null) {
    -                sm.checkPropertiesAccess();
    -            }
    -        } catch (SecurityException se) {
    -            canAccessSystemProps = false;
    -        }
    -
    -        if (canAccessSystemProps) {
    -            try {
    -                if (useHostIPAddress) {
    -                    hostName = InetAddress.getLocalHost().getHostAddress();
    -                } else {
    -                    hostName = InetAddressUtil.getLocalHostName();
    -                }
    -            } catch (UnknownHostException uhe) {
    -                LOG.info("Cannot determine localhost name or address. Using default: {}", DEFAULT_REGISTRY_PORT, uhe);
    -                hostName = DEFAULT_HOST;
    -            }
    -        } else {
    -            hostName = DEFAULT_HOST;
    -        }
    -
             server = findOrCreateMBeanServer();
    -
    -        try {
    -            // Create the connector if we need
    -            if (createConnector) {
    -                createJmxConnector(hostName);
    -            }
    -        } catch (IOException ioe) {
    -            LOG.warn("Could not create and start JMX connector.", ioe);
    -        }
         }
    -    
    +
         protected MBeanServer findOrCreateMBeanServer() {
     
             // return platform mbean server if the option is specified.
    @@ -593,43 +454,4 @@ protected MBeanServer findOrCreateMBeanServer() {
             return MBeanServerFactory.createMBeanServer(mBeanServerDefaultDomain);
         }
     
    -    protected void createJmxConnector(String host) throws IOException {
    -        StringHelper.notEmpty(serviceUrlPath, "serviceUrlPath");
    -        ObjectHelper.notNull(registryPort, "registryPort");
    -
    -        try {
    -            registry = LocateRegistry.createRegistry(registryPort);
    -            LOG.debug("Created JMXConnector RMI registry on port {}", registryPort);
    -        } catch (RemoteException ex) {
    -            // The registry may had been created, we could get the registry instead
    -        }
    -
    -        // must start with leading slash
    -        String path = serviceUrlPath.startsWith("/") ? serviceUrlPath : "/" + serviceUrlPath;
    -        // Create an RMI connector and start it
    -        final JMXServiceURL url;
    -        if (connectorPort > 0) {
    -            url = new JMXServiceURL("service:jmx:rmi://" + host + ":" + connectorPort + "/jndi/rmi://" + host
    -                                    + ":" + registryPort + path);
    -        } else {
    -            url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + host + ":" + registryPort + path);
    -        }
    -
    -        cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
    -
    -        // use async thread for starting the JMX Connector
    -        // (no need to use a thread pool or enlist in JMX as this thread is terminated when the JMX connector has been started)
    -        String threadName = camelContext.getExecutorServiceManager().resolveThreadName("JMXConnector: " + url);
    -        Thread thread = getCamelContext().getExecutorServiceManager().newThread(threadName, () -> {
    -            try {
    -                LOG.debug("Staring JMX Connector thread to listen at: {}", url);
    -                cs.start();
    -                LOG.info("JMX Connector thread started and listening at: {}", url);
    -            } catch (IOException ioe) {
    -                LOG.warn("Could not start JMXConnector thread at: " + url + ". JMX Connector not in use.", ioe);
    -            }
    -        });
    -        thread.start();
    -    }
    -
     }
    
  • core/camel-management/src/test/java/org/apache/camel/management/DefaultManagementAgentMockTest.java+0 2 modified
    @@ -76,7 +76,6 @@ public void testObjectNameModification() throws JMException {
         @Test
         public void testShouldUseHostIPAddressWhenFlagisTrue() throws Exception {
             System.setProperty(JmxSystemPropertyKeys.USE_HOST_IP_ADDRESS, "true");
    -        System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "true");
             CamelContext ctx = new DefaultCamelContext();
     
             ManagementAgent agent = new DefaultManagementAgent(ctx);
    @@ -88,7 +87,6 @@ public void testShouldUseHostIPAddressWhenFlagisTrue() throws Exception {
         @Test
         public void shouldUseHostNameWhenFlagisFalse() throws Exception {
             System.setProperty(JmxSystemPropertyKeys.USE_HOST_IP_ADDRESS, "false");
    -        System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "true");
             CamelContext ctx = new DefaultCamelContext();
     
             ManagementAgent agent = new DefaultManagementAgent(ctx);
    
  • core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java+0 2 modified
    @@ -205,8 +205,6 @@ public void tearDown() throws Exception {
                 System.clearProperty(JmxSystemPropertyKeys.USE_PLATFORM_MBS);
                 System.clearProperty(JmxSystemPropertyKeys.DOMAIN);
                 System.clearProperty(JmxSystemPropertyKeys.MBEAN_DOMAIN);
    -            System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    -            System.clearProperty(JmxSystemPropertyKeys.REGISTRY_PORT);
             }
         }
     
    
  • core/camel-management/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java+0 139 removed
    @@ -1,139 +0,0 @@
    -/*
    - * Licensed to the Apache Software Foundation (ASF) under one or more
    - * contributor license agreements.  See the NOTICE file distributed with
    - * this work for additional information regarding copyright ownership.
    - * The ASF licenses this file to You under the Apache License, Version 2.0
    - * (the "License"); you may not use this file except in compliance with
    - * the License.  You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package org.apache.camel.management;
    -
    -import java.rmi.NoSuchObjectException;
    -import java.rmi.registry.LocateRegistry;
    -import java.rmi.registry.Registry;
    -import java.util.Locale;
    -import java.util.Random;
    -
    -import javax.management.MBeanServerConnection;
    -import javax.management.remote.JMXConnector;
    -import javax.management.remote.JMXConnectorFactory;
    -import javax.management.remote.JMXServiceURL;
    -
    -import org.apache.camel.api.management.JmxSystemPropertyKeys;
    -import org.junit.After;
    -import org.junit.Before;
    -import org.junit.Test;
    -
    -/**
    - * Test that verifies JMX connector server can be connected by
    - * a client.
    - */
    -public class JmxInstrumentationWithConnectorTest extends JmxInstrumentationUsingDefaultsTest {
    -
    -    protected String url;
    -    protected JMXConnector clientConnector;
    -    protected int registryPort;
    -
    -    @Override
    -    protected boolean useJmx() {
    -        return true;
    -    }
    -
    -    @Override
    -    protected boolean canRunOnThisPlatform() {
    -        String os = System.getProperty("os.name");
    -        boolean aix = os.toLowerCase(Locale.ENGLISH).contains("aix");
    -        boolean windows = os.toLowerCase(Locale.ENGLISH).contains("windows");
    -        boolean solaris = os.toLowerCase(Locale.ENGLISH).contains("sunos");
    -
    -        // Does not work on AIX / solaris and the problem is hard to identify, could be issues not allowing to use a custom port
    -        // java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi/camel
    -
    -        // windows CI servers is often slow/tricky so skip as well
    -        return !aix && !solaris && !windows;
    -    }
    -
    -    @Override
    -    @Before
    -    public void setUp() throws Exception {
    -        registryPort = 30000 + new Random().nextInt(10000);
    -        log.info("Using port " + registryPort);
    -        url = "service:jmx:rmi:///jndi/rmi://localhost:" + registryPort + "/jmxrmi/camel";
    -
    -        // need to explicit set it to false to use non-platform mbs
    -        System.setProperty(JmxSystemPropertyKeys.USE_PLATFORM_MBS, "false");
    -        System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "true");
    -        System.setProperty(JmxSystemPropertyKeys.REGISTRY_PORT, "" + registryPort);
    -        super.setUp();
    -    }
    -
    -    @Override
    -    @After
    -    public void tearDown() throws Exception {
    -        if (clientConnector != null) {
    -            try {
    -                clientConnector.close();
    -            } catch (Exception e) {
    -                // ignore
    -            }
    -            clientConnector = null;
    -        }
    -        // restore environment to original state
    -        // the following properties may have been set by specialization of this test class
    -        System.clearProperty(JmxSystemPropertyKeys.USE_PLATFORM_MBS);
    -        System.clearProperty(JmxSystemPropertyKeys.DOMAIN);
    -        System.clearProperty(JmxSystemPropertyKeys.MBEAN_DOMAIN);
    -        System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    -        System.clearProperty(JmxSystemPropertyKeys.REGISTRY_PORT);
    -
    -        super.tearDown();
    -    }
    -
    -    @Override
    -    protected MBeanServerConnection getMBeanConnection() throws Exception {
    -        if (mbsc == null) {
    -            if (clientConnector == null) {
    -                clientConnector = JMXConnectorFactory.connect(new JMXServiceURL(url), null);
    -            }
    -            mbsc = clientConnector.getMBeanServerConnection();
    -        }
    -        return mbsc;
    -    }
    -
    -    @Test
    -    public void testRmiRegistryUnexported() throws Exception {
    -
    -        Registry registry = LocateRegistry.getRegistry(registryPort);
    -
    -        // before we stop the context the registry is still exported, so list() should work
    -        Exception e;
    -        try {
    -            registry.list();
    -            e = null;
    -        } catch (NoSuchObjectException nsoe) {
    -            e = nsoe;
    -        }
    -        assertNull(e);
    -
    -        // stop the Camel context
    -        context.stop();
    -
    -        // stopping the Camel context unexported the registry, so list() should fail
    -        Exception e2;
    -        try {
    -            registry.list();
    -            e2 = null;
    -        } catch (NoSuchObjectException nsoe) {
    -            e2 = nsoe;
    -        }
    -        assertNotNull(e2);
    -    }
    -}
    
  • core/camel-management/src/test/java/org/apache/camel/management/ManagedComponentTest.java+0 1 modified
    @@ -43,7 +43,6 @@ public class ManagedComponentTest extends ManagementTestSupport {
         protected CamelContext createCamelContext() throws Exception {
             CamelContext context = super.createCamelContext();
             context.init();
    -        context.getManagementStrategy().getManagementAgent().setCreateConnector(true);
             context.addComponent("my-verifiable-component", new MyVerifiableComponent());
             context.addComponent("direct", new DirectComponent());
     
    
  • core/camel-management/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java+0 16 modified
    @@ -19,26 +19,10 @@
     import org.apache.camel.CamelExecutionException;
     import org.apache.camel.api.management.JmxSystemPropertyKeys;
     import org.apache.camel.builder.RouteBuilder;
    -import org.junit.After;
    -import org.junit.Before;
     import org.junit.Test;
     
     public class ManagedRouteWithOnExceptionTest extends ManagementTestSupport {
     
    -    @Override
    -    @Before
    -    public void setUp() throws Exception {
    -        System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "true");
    -        super.setUp();
    -    }
    -
    -    @Override
    -    @After
    -    public void tearDown() throws Exception {
    -        System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    -        super.tearDown();
    -    }
    -
         @Test
         public void testShouldBeInstrumentedOk() throws Exception {
             getMockEndpoint("mock:error").expectedMessageCount(0);
    
  • core/camel-management/src/test/java/org/apache/camel/management/ManagedServiceUrlPathTest.java+0 106 removed
    @@ -1,106 +0,0 @@
    -/*
    - * Licensed to the Apache Software Foundation (ASF) under one or more
    - * contributor license agreements.  See the NOTICE file distributed with
    - * this work for additional information regarding copyright ownership.
    - * The ASF licenses this file to You under the Apache License, Version 2.0
    - * (the "License"); you may not use this file except in compliance with
    - * the License.  You may obtain a copy of the License at
    - *
    - *      http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    - */
    -package org.apache.camel.management;
    -
    -import javax.management.MBeanServerConnection;
    -import javax.management.ObjectName;
    -import javax.management.remote.JMXConnector;
    -import javax.management.remote.JMXConnectorFactory;
    -import javax.management.remote.JMXServiceURL;
    -
    -import org.apache.camel.CamelContext;
    -import org.apache.camel.builder.RouteBuilder;
    -import org.junit.After;
    -import org.junit.Test;
    -
    -public class ManagedServiceUrlPathTest extends ManagementTestSupport {
    -
    -    private static final String JMXSERVICEURL = "service:jmx:rmi:///jndi/rmi://localhost:2113/foo/bar";
    -    private JMXConnector clientConnector;
    -
    -    @Override
    -    protected CamelContext createCamelContext() throws Exception {
    -        CamelContext context = super.createCamelContext();
    -
    -        // START SNIPPET: e1
    -        context.getManagementStrategy().getManagementAgent().setServiceUrlPath("/foo/bar");
    -        context.getManagementStrategy().getManagementAgent().setRegistryPort(2113);
    -        context.getManagementStrategy().getManagementAgent().setCreateConnector(true);
    -        // END SNIPPET: e1
    -
    -        return context;
    -    }
    -
    -    @Override
    -    protected boolean canRunOnThisPlatform() {
    -        // does not work well when maven surefire plugin is set to forkmode=once
    -        return false;
    -    }
    -
    -    @Override
    -    @After
    -    public void tearDown() throws Exception {
    -        super.tearDown();
    -        try {
    -            if (clientConnector != null) {
    -                clientConnector.close();
    -            }
    -        } catch (Throwable e) {
    -            // ignore
    -        }
    -    }
    -
    -    @Test
    -    public void testConnectToJmx() throws Exception {
    -        // JMX tests dont work well on AIX CI servers (hangs them)
    -        if (isPlatform("aix")) {
    -            return;
    -        }
    -
    -        clientConnector = JMXConnectorFactory.connect(new JMXServiceURL(JMXSERVICEURL), null);
    -        MBeanServerConnection mbeanServer = clientConnector.getMBeanServerConnection();
    -
    -        ObjectName name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"direct://start\"");
    -        String uri = (String) mbeanServer.getAttribute(name, "EndpointUri");
    -        assertEquals("direct://start", uri);
    -
    -        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"log://foo\"");
    -        uri = (String) mbeanServer.getAttribute(name, "EndpointUri");
    -        assertEquals("log://foo", uri);
    -
    -        name = ObjectName.getInstance("org.apache.camel:context=camel-1,type=endpoints,name=\"mock://result\"");
    -        uri = (String) mbeanServer.getAttribute(name, "EndpointUri");
    -        assertEquals("mock://result", uri);
    -
    -        String id = (String) mbeanServer.getAttribute(name, "CamelId");
    -        assertEquals("camel-1", id);
    -
    -        Boolean singleton = (Boolean) mbeanServer.getAttribute(name, "Singleton");
    -        assertEquals(Boolean.TRUE, singleton);
    -    }
    -
    -    @Override
    -    protected RouteBuilder createRouteBuilder() throws Exception {
    -        return new RouteBuilder() {
    -            @Override
    -            public void configure() throws Exception {
    -                from("direct:start").to("log:foo").to("mock:result");
    -            }
    -        };
    -    }
    -
    -}
    
  • core/camel-management/src/test/java/org/apache/camel/management/ManagementTestSupport.java+0 18 modified
    @@ -26,35 +26,17 @@
     import javax.management.ReflectionException;
     
     import org.apache.camel.ContextTestSupport;
    -import org.apache.camel.api.management.JmxSystemPropertyKeys;
    -import org.apache.camel.management.util.AvailablePortFinder;
    -import org.junit.Before;
     
     /**
      * Base class for JMX tests.
      */
     public abstract class ManagementTestSupport extends ContextTestSupport {
     
    -    protected int registryPort;
    -    protected String url;
    -
         @Override
         protected boolean useJmx() {
             return true;
         }
     
    -    @Override
    -    @Before
    -    public void setUp() throws Exception {
    -        registryPort = AvailablePortFinder.getNextAvailable();
    -        log.info("Using port " + registryPort);
    -
    -        // need to explicit set it to false to use non-platform mbs
    -        System.setProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR, "true");
    -        System.setProperty(JmxSystemPropertyKeys.REGISTRY_PORT, "" + registryPort);
    -        super.setUp();
    -    }
    -
         protected MBeanServer getMBeanServer() {
             return context.getManagementStrategy().getManagementAgent().getMBeanServer();
         }
    
  • docs/components/modules/ROOT/pages/influxdb-component.adoc+2 1 modified
    @@ -47,13 +47,14 @@ configured in the registry, using the native java driver.
     
     
     // component options: START
    -The InfluxDB component supports 2 options, which are listed below.
    +The InfluxDB component supports 3 options, which are listed below.
     
     
     
     [width="100%",cols="2,5,^1,2",options="header"]
     |===
     | Name | Description | Default | Type
    +| *influxDB* (producer) | The shared Influx DB to use for all endpoints |  | InfluxDB
     | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean
     | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
     |===
    
  • docs/components/modules/ROOT/pages/nats-component.adoc+3 2 modified
    @@ -36,14 +36,15 @@ Where *topic* is the topic name
     
     
     // component options: START
    -The Nats component supports 5 options, which are listed below.
    +The Nats component supports 6 options, which are listed below.
     
     
     
     [width="100%",cols="2,5,^1,2",options="header"]
     |===
     | Name | Description | Default | Type
     | *servers* (common) | URLs to one or more NAT servers. Use comma to separate URLs when specifying multiple servers. |  | String
    +| *verbose* (common) | Whether or not running in verbose mode | false | boolean
     | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
     | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean
     | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
    @@ -87,7 +88,7 @@ with the following path and query parameters:
     | *maxReconnectAttempts* (common) | Max reconnection attempts | 60 | int
     | *noEcho* (common) | Turn off echo. If supported by the gnatsd version you are connecting to this flag will prevent the server from echoing messages back to the connection if it has subscriptions on the subject being published to. | false | boolean
     | *noRandomizeServers* (common) | Whether or not randomizing the order of servers for the connection attempts | false | boolean
    -| *pedantic* (common) | Whether or not running in pedantic mode (this affects performace) | false | boolean
    +| *pedantic* (common) | Whether or not running in pedantic mode (this affects performance) | false | boolean
     | *pingInterval* (common) | Ping interval to be aware if connection is still alive (in milliseconds) | 120000 | int
     | *reconnect* (common) | Whether or not using reconnection feature | true | boolean
     | *reconnectTimeWait* (common) | Waiting time before attempts reconnection (in milliseconds) | 2000 | int
    
  • docs/user-manual/modules/ROOT/pages/jmx.adoc+12 6 modified
    @@ -124,7 +124,7 @@ property. The `MBeanServer` default domain name configuration is ignored
     as it is not applicable.
     
     [CAUTION]
    -Starting in next release (1.5), the default
    +Starting from the 1.5 release, the default
     value of `usePlatformMBeanServer` will be changed to `true`. You can set
     the property to `false` to disable using platform `MBeanServer`.
     
    @@ -146,6 +146,9 @@ Spring configuration:
     
     == Creating JMX RMI Connector Server
     
    +[CAUTION]
    +Starting from Camel 3.2.0, the configuration in this section no longer applies.
    +
     JMX connector server enables MBeans to be remotely managed by a JMX
     client such as JConsole; Camel JMX RMI connector server can be
     optionally turned on by setting system property and the `MBeanServer`
    @@ -169,6 +172,9 @@ Spring configuration:
     
     == JMX Service URL
     
    +[CAUTION]
    +Starting from Camel 3.2.0, the configuration in this section no longer applies.
    +
     The default JMX Service URL has the format:
     
     [source]
    @@ -358,7 +364,7 @@ information here, like the connector's port or the path name.
     [source,xml]
     ----
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    -  <jmxAgent id="agent" createConnector="true" registryPort="2000" mbeanServerDefaultDomain="org.apache.camel.test"/>
    +  <jmxAgent id="agent" mbeanServerDefaultDomain="org.apache.camel.test"/>
         <route>
           <from uri="seda:start"/>
           <to uri="mock:result"/>
    @@ -404,17 +410,17 @@ Camel directly, you'll have to pass these parameters yourself.)
     |`mbeanObjectDomainName` |`org.apache.camel.jmx.mbeanObjectDomainName`
     |`org.apache.camel` |The JMX domain that all object names will use
     
    -|`createConnector` |`org.apache.camel.jmx.createRmiConnect` |`false` |If
    +|*Removed in 3.2.0:* `createConnector` |`org.apache.camel.jmx.createRmiConnect` |`false` |If
     we should create a JMX connector (to allow remote management) for the
     `MBeanServer`
     
    -|`registryPort` |`org.apache.camel.jmx.rmiConnector.registryPort`
    +|*Removed in 3.2.0:* `registryPort` |`org.apache.camel.jmx.rmiConnector.registryPort`
     |`1099` |The port that the JMX RMI registry will use
     
    -|`connectorPort` |`org.apache.camel.jmx.rmiConnector.connectorPort` |-1
    +|*Removed in 3.2.0:* `connectorPort` |`org.apache.camel.jmx.rmiConnector.connectorPort` |-1
     (dynamic) |The port that the JMX RMI server will use
     
    -|`serviceUrlPath` |`org.apache.camel.jmx.serviceUrlPath`
    +|*Removed in 3.2.0:* `serviceUrlPath` |`org.apache.camel.jmx.serviceUrlPath`
     |`/jmxrmi/camel` |The path that JMX connector will be registered under
     
     |`onlyRegisterProcessorWithCustomId`
    
  • tooling/maven/camel-package-maven-plugin/src/test/java/org/apache/camel/maven/packaging/MyConfiguration.java+0 13 modified
    @@ -57,7 +57,6 @@ public class MyConfiguration {
         private boolean useDataType;
         private boolean useBreadcrumb;
         private String jmxManagementNamePattern = "#name#";
    -    private boolean jmxCreateConnector;
         private boolean useMdcLogging;
         private String threadNamePattern;
         private String routeFilterIncludePattern;
    @@ -511,18 +510,6 @@ public void setJmxManagementNamePattern(String jmxManagementNamePattern) {
             this.jmxManagementNamePattern = jmxManagementNamePattern;
         }
     
    -    public boolean isJmxCreateConnector() {
    -        return jmxCreateConnector;
    -    }
    -
    -    /**
    -     * Whether JMX connector is created, allowing clients to connect remotely
    -     * The default value is false.
    -     */
    -    public void setJmxCreateConnector(boolean jmxCreateConnector) {
    -        this.jmxCreateConnector = jmxCreateConnector;
    -    }
    -
         public boolean isUseMdcLogging() {
             return useMdcLogging;
         }
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

29

News mentions

0

No linked articles in our index yet.