Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16225

camel-karaf - route-list command fail with NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.7.0, 3.7.1, 3.7.2, 3.8.0
    • 3.7.3, 3.9.0
    • karaf
    • None
    • Unknown

    Description

      I'm running apache-camel within a apache-karaf container.
      Now I recognized the problem, that the route-list command failed, with
      the following scenario:

      I have route configured where bundle1 reads the data from a file and
      forwards the content to a route of bundle 2, using a VmEndpoint.

      After startup the route-list command works fine, but as soon as an
      incoming message has been processed, the command failed with a
      NullPointerException.

      I think the problem is located in the DefaultManagementObjectNameStrategy.
      Here I can see, the in method getObjectNameForRoute(..)
      The camelContext is picked from the Endpoint.
      Is there a special reason, why it is not read from the provided route directly?

       

      @Override
      public ObjectName getObjectNameForRoute(org.apache.camel.Route route) throws MalformedObjectNameException {
          Endpoint ep = route.getEndpoint();
          String id = route.getId();
      
          StringBuilder buffer = new StringBuilder();
          buffer.append(domainName).append(":");
          buffer.append(KEY_CONTEXT + "=").append(getContextId(ep.getCamelContext())).append(",");
          buffer.append(KEY_TYPE + "=" + TYPE_ROUTE + ",");
          buffer.append(KEY_NAME + "=").append(ObjectName.quote(id));
          return createObjectName(buffer);
      } 

      As in my test-case the context of the endpoint and route differ, this
      seems to be the reason, why the JMX-object could not be resolved.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jansenj Jörg Jansen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: