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

ClassNotFoundException while indexing data into Elasticsearch org.elasticsearch.common.CheckedConsumer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 3.12.0
    • None
    • None

    Description

      I am using below stack to index a data into Elasticsearch using Camel Elasticsearch component:

      • Elasticsearch 7.15.0
      • Apache Camel 3.12.0
      • Spring 5.3.12
      • Spring Boot 2.5.6

      While indexing the data into Elasticsearch 7.15.0, I am getting ClassNotFoundException: org.elasticsearch.common.CheckedConsumer

      please have a look on the detailed error below:

      Caused by: java.lang.ClassNotFoundException: org.elasticsearch.common.CheckedConsumer
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_92]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_92]
      at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[indexer-IPM-12.0.4-CP4D-SNAPSHOT.jar:?]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_92]
      at org.apache.camel.component.elasticsearch.ElasticsearchProducer$HighLevelClient.<init>(ElasticsearchProducer.java:347) ~[camel-elasticsearch-rest-3.12.0.jar:3.12.0]
      at org.apache.camel.component.elasticsearch.ElasticsearchProducer$HighLevelClient.<init>(ElasticsearchProducer.java:345) ~[camel-elasticsearch-rest-3.12.0.jar:3.12.0]
      at org.apache.camel.component.elasticsearch.ElasticsearchProducer.process(ElasticsearchProducer.java:124) ~[camel-elasticsearch-rest-3.12.0.jar:3.12.0]
      at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) ~[camel-support-3.12.0.jar:3.12.0]
      ... 11 more 

      I investigated the issue in details and came to know that package org.elasticsearch.common.CheckedConsumer is present in elasticsearch-core-7.13.0.jar but the common package is completely missing in elasticsearch-core-7.15.0.jar. This is why while talking with Elasticsearch using Apache Camel component we are getting this runtime error.

      Please have a look on the attached images for the package structure and class information in respective jars.

      Attachments

        1. Elasticsearch7.13.0.png
          16 kB
          Nikhil
        2. Elasticsearch7.15.0.png
          5 kB
          Nikhil

        Activity

          People

            Unassigned Unassigned
            nikhil_khode@persistent.com Nikhil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: