Why camel-elasticsearch component fails in an OSGi environment due to missing names.txt ?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Issue

  • User use the component camel-elasticsearch.
  • User found the following error
Failed to resolve config path [names.txt], tried file path [names.txt], path file [xxx/config/names.txt], and classpath
   at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:945)
   at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:187)
...
Caused by: org.elasticsearch.env.FailedToResolveConfigException: Failed to resolve config path [names.txt], tried file path [names.txt], path file [xxx/config/names.txt], and classpath
   at org.elasticsearch.env.Environment.resolveConfig(Environment.java:213)
   at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:119)
  • After searching on camel JIRA, user found the following ticket : https://issues.apache.org/jira/browse/CAMEL-8194.
  • This JIRA is fixed with camel versions 2.13.4, 2.14.2, 2.15.0.
  • How this problem can be resolved in Red Hat JBoss Fuse V6.1 ?

Resolution

  • Currently this fix is not applied to Red Hat JBoss Fuse 6.1.0, hence a patch request is raised https://issues.jboss.org/browse/ENTESB-3322.
  • Currently this fix is scheduled to release with R2P5 patch.
  • There is alternative solution as well where user can place names.txt within location ${karaf.home}/config. User has to manually create config folder within Red Hat JBoss Fuse installation folder. For this solution names.txt.zip is attached, user should extract this zip and place names.txt file within config folder.
  • If following above solutions user face another error as below
Caused by: java.lang.NoClassDefFoundError: org/tartarus/snowball/SnowballProgram
    at org.elasticsearch.indices.analysis.IndicesAnalysisService.<init>(IndicesAnalysisService.java:126)
    at sun.reflect.GeneratedConstructorAccessor44.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

Attachments

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments