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

Please add camel-core-osgi to Camel Karaf feature repo

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.23.1
    • Fix Version/s: 3.0.0-M3, 3.0.0
    • Component/s: karaf, osgi
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I was following this documentation http://camel.apache.org/karaf.html in order to make Camel work in Karaf.

      Many tutorials point to this configuration:

      @Override
      public void start(final BundleContext bundleContext) throws Exception {
        camelContext = new OsgiDefaultCamelContext(bundleContext);
        registrationCamelContext = bundleContext.registerService(CamelContext.class, camelContext, null);
        camelContext.start();
      }
      

      Unfortunately, when I install Camel in karaf:

      karaf@root> feature:repo-add camel 2.23.1
      

      only camel-core can be installed, while camel-core-osgi is missing.

      Unfortunately camel-core contains only 

      DefaultCamelContext

      which causes classpath problems in Karaf. For example I import camel-http4, but I get:

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: http4://my.site due to: No component found with scheme: http4
      

      or I import camel-jackson, but I get:

      Caused by: java.lang.IllegalArgumentException: Data format 'json-jackson' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath
      

      The solution is to use:

      OsgiDefaultCamelContext

      which is located in camel-core-osgi, which is unavailable in Camel Karaf repo.

       

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              eximius Kamil
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: