1

According to the Osmosis Github site I've installed Osmosis and I am trying to put an osm package to Elasticsearch by typing:

$ osmosis --read-pbf ~/osm/extract/azores-latest.osm.pbf --write-elasticsearch cluster.hosts="localhost"

The execution fails with:

SEVERE: Execution aborted.
java.lang.NullPointerException at org.openstreetmap.osmosis.plugin.elasticsearch.utils.Parameters$Builder.loadResource(Parameters.java:57)
at org.openstreetmap.osmosis.plugin.elasticsearch.ElasticSearchWriterFactory.buildPluginParameters(ElasticSearchWriterFactory.java:49)
at org.openstreetmap.osmosis.plugin.elasticsearch.ElasticSearchWriterFactory.createTaskManagerImpl(ElasticSearchWriterFactory.java:27)
at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory.createTaskManager(TaskManagerFactory.java:60)

The ElasticSearchWriterFactory handles "plugin.properties" to the Parameters$Builder.loadResource() method. I've tried to figure the problem out by adding some log lines into the /elasticsearch-osmosis-plugin-1.3.0.jar. So I get:

resource: plugin.properties
getClass() : class org.openstreetmap.osmosis.plugin.elasticsearch.utils.Parameters$Builder
getClass().getClassLoader() : ClassRealm[osmosis.core, parent: null]
getClass().getName() : org.openstreetmap.osmosis.plugin.elasticsearch.utils.Parameters$Builder
getClass().getPackage() : package org.openstreetmap.osmosis.plugin.elasticsearch.utils
getClass().getClassLoader().getResource(resource) : null
getClass().getClassLoader().getResource("/opt/osmosis-0.43/" + resource) : null

(The last line in order to test if the relative path was the problem but that does not seem to be the problem.)

I'va also copied plugin.properties to any location / path that I could imagine to be part of interest, i.e. package root etc. ... with no success.

Anybody an idea how to solve that? Thanks very much!

philburns
  • 310
  • 4
  • 18
  • Your output contains `getClass().getClassLoader().getResource(resource) : null`. The null pointer exception results from calling `openStream` on that. – Andy Turner Mar 26 '15 at 11:03
  • @AndyTurner I agree, but why is it null when there is a file called "plugin.properties"? Thanks! – philburns Mar 26 '15 at 12:08

0 Answers0