Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.14.1
-
Component/s: camel-elasticsearch
-
Labels:None
-
Estimated Complexity:Novice
Description
2014-12-29 22:25:12,667 | ERROR | FelixStartLevel | BlueprintCamelContext | 8 - org.apache.camel.camel-blueprint - 2.14.0 | Error occurred during starting Camel: CamelContext(elasticSearchProducerCamelContext) due Failed to create route log-event-sink-elasticsearch at: >>> Aggregate[true -> [To[log:xxx?level=INFO&groupInterval=2000], To[elasticsearch://elasticsearch?ip=127.0.0.1&port=9300]]] <<< in route: Route(log-event-sink-elasticsearch)[[From[vm:log-event-elast... because of Failed to resolve endpoint: elasticsearch://elasticsearch?ip=127.0.0.1&port=9300 due to: Failed to resolve config path [names.txt], tried file path [names.txt], path file [xxx/config/names.txt], and classpath org.apache.camel.FailedToCreateRouteException: Failed to create route log-event-sink-elasticsearch at: >>> Aggregate[true -> [To[log:xxx?level=INFO&groupInterval=2000], To[elasticsearch://elasticsearch?ip=127.0.0.1&port=9300]]] <<< in route: Route(log-event-sink-elasticsearch)[[From[vm:log-event-elast... because of Failed to resolve endpoint: elasticsearch://elasticsearch?ip=127.0.0.1&port=9300 due to: 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) ...
This can be fixed by adding a one-liner to explicitly set the classloader on the elasticsearch Settings class to the classloader of Settings.class:
Settings settings = ImmutableSettings.settingsBuilder()
...
.classLoader(Settings.class.getClassLoader());
...
Attachments
Issue Links
- relates to
-
CAMEL-8816 Elasticsearch component fails in an OSGi environment due to missing names.txt
-
- Resolved
-