Osmosis doesn't find the plugin

1,286 views
Skip to first unread message

Rob Black

unread,
Apr 11, 2013, 5:32:03 AM4/11/13
to mapsfo...@googlegroups.com
Hello everybody,

I am trying to get the mapsforge mapwriter plugin to work with Osmosis 0.42-6.
I am working on a Windows 8 machine and the installation paths are as follows:

Plugin dir:
C:\Users\Rob\.openstreetmap\osmosis\lib\plugins\mapsforge.jar

Install path osmosis:
D:\Downloads\osmosis\

Now my rendering command and the errors I get:
D:\Downloads\osmosis>bin\osmosis --rb file=data\germany-latest.osm.pbf --mapfile-writer file=tmp\germany-latest.map type=hd
Apr 11, 2013 11:25:11 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.42-6-gf39a160-dirty
Apr 11, 2013 11:25:12 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Apr 11, 2013 11:25:12 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type mapfile-writer doesn't exist.
        at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactoryRegister.getInstance(TaskManagerFactoryRegister.java:60)
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.buildTasks(Pipeline.java:50)
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:112)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86)
        at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

I think, the problem is that the plugin is not found. I also copied it into the install dir of osmosis as mentioned above, but that doesn't worked for me either. Then I tried the "-p" command as mentioned in another post, but the only thing I get is unable to load class. I've installed the newest version of trove into the osmosis default libs, but that doesn't help a thing.

Please give me some advice.
Best Regards
Rob

Karussell

unread,
Apr 11, 2013, 5:44:09 AM4/11/13
to mapsfo...@googlegroups.com
IMO only older osmosis versions will work: " tested with Osmosis 0.36 - 0.40.1"

Peter.

--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rob Black

unread,
Apr 11, 2013, 7:12:01 AM4/11/13
to mapsfo...@googlegroups.com
Hi Peter,
thanks for the advice. I downloaded Osmosis 0.40.1 now, but it seems like nothing has changed. I get the same errors, it doesn't matter which form of plugin implementation I use.
Greetings,
Rob

Ludwig

unread,
Apr 11, 2013, 7:34:02 AM4/11/13
to mapsfo...@googlegroups.com
I think you have two different errors:
  1. For the first you give the stacktrace, there it does not seem to find your plug-in, so something in the path is wrong. I do not use Windows, so I cannot help with this.
  2. You say, that if you use the -p option, it gives you a different error, unable to load class. I think this might be resolved if you use osmosis < 0.41. What is the exact error message you get there?

Ludwig

Rob Black

unread,
Apr 11, 2013, 7:39:39 AM4/11/13
to mapsfo...@googlegroups.com
Hi Ludwig,
the exact error when I try it with Osmosis 0.40.1:

D:\Downloads\lbg\osmosis-0.40.1\osmosis-0.40.1\bin>osmosis -p mapsforge.jar
Apr 11, 2013 1:36:19 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Apr 11, 2013 1:36:19 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load plugin class (mapsforge.jar).
        at org.openstreetmap.osmosis.core.TaskRegistrar.loadPluginClass(TaskRegistrar.java:334)
        at org.openstreetmap.osmosis.core.TaskRegistrar.loadPlugin(TaskRegistrar.java:313)
        at org.openstreetmap.osmosis.core.TaskRegistrar.initialize(TaskRegistrar.java:84)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:81)

        at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: java.lang.ClassNotFoundException: mapsforge.jar
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
        at org.openstreetmap.osmosis.core.TaskRegistrar.loadPluginClass(TaskRegistrar.java:332)
        ... 13 more

I have copied the mapsforge.jar to the \bin\ dir, but that doesn't work either. Any ideas?
Greetings,
Rob

Ludwig

unread,
Apr 11, 2013, 7:43:46 AM4/11/13
to mapsfo...@googlegroups.com

Robert Schwarz

unread,
Apr 11, 2013, 7:50:13 AM4/11/13
to mapsfo...@googlegroups.com

The mapsforge.jar is the maps writer jar. I just renamed it to not to write too much in the cmd. Could this be the cause?
Greetings,
Rob

You received this message because you are subscribed to a topic in the Google Groups "mapsforge-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapsforge-dev/L-iEj0jdxWY/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to mapsforge-de...@googlegroups.com.

Ludwig

unread,
Apr 11, 2013, 8:07:40 AM4/11/13
to mapsfo...@googlegroups.com
No, that would not be the cause.

emux

unread,
Apr 11, 2013, 9:00:02 AM4/11/13
to mapsfo...@googlegroups.com
A simple way to make osmosis work with mapsforge is:

- Copy mapsforge-map-writer-0.3.1-SNAPSHOT-jar-with-dependencies.jar (from Ludwig's link) at "osmosis/lib/default" folder
- Create a text file "osmosis-plugins.conf" at "osmosis/config" folder (if it isn't already exist)
- Add this line to the text file:
org.mapsforge.map.writer.osmosis.MapFileWriterPluginLoader

Martin Vennekamp

unread,
Apr 17, 2013, 6:18:13 PM4/17/13
to mapsfo...@googlegroups.com
Thanks this finalyworked for me! (win7)

Muhammad Alizadeh

unread,
Jan 4, 2015, 9:40:01 AM1/4/15
to mapsfo...@googlegroups.com

@Emux

when I do what you have suggested, I get this error:

 org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type "mapfile-writer" already exists.

WHat shall I do ?

Emux

unread,
Jan 4, 2015, 9:49:28 AM1/4/15
to mapsfo...@googlegroups.com
In newer versions we include the proper plugin info for Osmosis inside the Mapsforge plugin.

So all you have to do now is putting the latest map writer plugin jar inside latest Osmosis lib/default folder.
(Make sure you have only one map writer in Osmosis class path)

--
Emux
Cruiser - Atlas

Ludwig

unread,
Jan 4, 2015, 12:18:08 PM1/4/15
to mapsfo...@googlegroups.com

You probably have two writer jars on your path...

--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.

Akarsh Seggemu

unread,
Apr 29, 2017, 3:27:24 PM4/29/17
to mapsforge-dev
Hi Emux & Ludwig,

I installed osmosis via brew on mac book pro macOS Sierra (10.12.3).
I placed the "mapsforge-map-writer-0.7.0-jar-with-dependencies.jar" in the folder "/usr/local/Cellar/osmosis/0.45/libexec/lib/default/".
I get the following error message

osmosis --rx file=data_1_new.osm --mapfile-writer file=data_1.map
Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.45
Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Apr 29, 2017 9:21:06 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile-writer version: mapsforge-map-writer-master-SNAPSHOT
Apr 29, 2017 9:21:06 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask <init>
INFO: mapfile format specification version: 3
Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Apr 29, 2017 9:21:06 PM org.mapsforge.map.writer.osmosis.MapFileWriterTask process
SEVERE: No valid bounding box found in input data.
Please provide valid bounding box via command line parameter 'bbox=minLat,minLon,maxLat,maxLon'.
Tile based data store not initialized. Aborting...
Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-rx failed
java.lang.IllegalStateException: tile based data store not initialized, missing bounding box information in input data
    at org.mapsforge.map.writer.osmosis.MapFileWriterTask.process(MapFileWriterTask.java:157)
    at org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.end(NodeElementProcessor.java:139)
    at org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:107)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:90)
    at java.lang.Thread.run(Thread.java:745)

Apr 29, 2017 9:21:06 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
    at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
    at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)

    at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)


Please can you suggest how to trouble shoot the issue.

Thank you

Emux

unread,
Apr 29, 2017, 3:36:39 PM4/29/17
to mapsfo...@googlegroups.com
As seen in map-writer plugin installation section you can have a look at Osmosis documentation for more convenient ways to install plugins.

Regarding the exception it probably needs to provide a bounding box (see also map-writer docs).

--
Emux
Reply all
Reply to author
Forward
0 new messages