osmosis java version requirments, please

Does any one know what version of java is required for running osmosis?

Some java components are depreciated so osmosis does not work.

My java version is:

javac -version
javac 1.8.0_191

I would really appreciate any help here.

Alternatively I could help fix the problem but I don’t know how to go about helping. I am primarily a php programmer but can program multiple languages.

Thanks in advance!

Hi,

that is the current java 8 version. But there is a new version 11 too.

There are at least 2 “Javas”: one that is maintaned by Sun/Oracle and OpenJDK Java which is OpenSource, i think.

You are using the Oracle one and most of us are using the JDK. IIRC the developers too.


openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)

Please open a command window (terminal for linux or something like cmd for windows) and start josm using the command line “josm”. And please post the log.

something like


wambacher@server2:~/snapshots/2018$ josm
Using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to execute josm.
2018-12-15 10:41:56.242 INFORMATION: Protokollierungsgrad ist bei INFORMATION (INFO, 800)
2018-12-15 10:42:04.217 INFORMATION: Ungültige Erweiterungsbeschreibung '${plugin.description}' in Erweiterung config
2018-12-15 10:42:04.994 INFORMATION: Erweiterung 'jaxb' wird geladen (Version 34506)
2018-12-15 10:42:04.998 INFORMATION: Erweiterung 'log4j' wird geladen (Version 34527)
2018-12-15 10:42:07.624 INFORMATION: GET https://josm.openstreetmap.de/wiki/De:StartupPage -> 200
2018-12-15 10:42:08.376 INFORMATION: GET https://josm.openstreetmap.de/maps?ids=Bing%2CDigitalGlobe-Premium%2CDigitalGlobe-Standard%2CEsriWorldImagery%2CEsriWorldImageryClarity%2Cosm-mapnik-german_style%2Cstandard -> 304
Warning: Nashorn engine is planned to be removed from a future JDK release
2018-12-15 10:42:08.937 WARNUNG: Not a single layer for the name 'AeroWest': []
2018-12-15 10:42:08.937 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.938 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.938 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.938 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.939 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.939 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.940 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.940 WARNUNG: Not a single layer for the name 'Bing Sat': []
2018-12-15 10:42:08.940 WARNUNG: Not a single layer for the name 'wms.wambachers-osm.website: Stadtteilgrenzen_KreisRE': []
2018-12-15 10:42:10.229 SCHWERWIEGEND: Fehler beim Laden des Bildes 'dialogs/up.png'
2018-12-15 10:42:10.230 WARNUNG:  Sidewalk both: Could not get presets icon dialogs/up.png
2018-12-15 10:42:10.231 SCHWERWIEGEND: Fehler beim Laden des Bildes 'dialogs/previous.png'
2018-12-15 10:42:10.231 WARNUNG:  Sidewalk left: Could not get presets icon dialogs/previous.png
2018-12-15 10:42:10.233 SCHWERWIEGEND: Fehler beim Laden des Bildes 'dialogs/next.png'
2018-12-15 10:42:10.233 WARNUNG:  Sidewalk right: Could not get presets icon dialogs/next.png
2018-12-15 10:42:10.241 SCHWERWIEGEND: Fehler beim Laden des Bildes 'presets/way_unclassified.png'
2018-12-15 10:42:10.242 WARNUNG:  Sidewalk no: Could not get presets icon presets/way_unclassified.png
2018-12-15 10:42:10.245 SCHWERWIEGEND: Fehler beim Laden des Bildes 'presets/bus_halt.png'
2018-12-15 10:42:10.246 WARNUNG:  Bus Haltestelle/Schild: Could not get presets icon presets/bus_halt.png
2018-12-15 10:42:10.491 INFORMATION: Defaults for imagery.generic.default_autozoom differ:  != true
2018-12-15 10:42:10.492 INFORMATION: Defaults for imagery.generic.default_autoload differ:  != true
2018-12-15 10:42:10.493 INFORMATION: Defaults for imagery.generic.default_showerrors differ:  != true
Warning: Nashorn engine is planned to be removed from a future JDK release
2018-12-15 10:42:10.552 INFORMATION: Could not load tool definition continuosdownload/activate
2018-12-15 10:42:11.117 INFORMATION: Erweiterung 'reverter' wird geladen (Version 34552)
2018-12-15 10:42:11.145 INFORMATION: RemoteControl: adding command "revert_changeset" (handled by RevertChangesetHandler)
2018-12-15 10:42:11.163 INFORMATION: Erweiterung 'apache-commons' wird geladen (Version 34506)
2018-12-15 10:42:11.189 INFORMATION: Erweiterung 'reltoolbox' wird geladen (Version 34614)
2018-12-15 10:42:11.196 INFORMATION: Erweiterung 'jts' wird geladen (Version 34524)
2018-12-15 10:42:11.209 INFORMATION: Erweiterung 'ejml' wird geladen (Version 34389)
2018-12-15 10:42:11.250 INFORMATION: Erweiterung 'geotools' wird geladen (Version 34513)
2018-12-15 10:42:11.316 WARNUNG: No configuration settings found.  Using hardcoded default values for all pools.
2018-12-15 10:42:12.387 INFORMATION: Warp/affine reduction enabled: true
2018-12-15 10:42:14.137 INFORMATION: dataFileCache open start
2018-12-15 10:42:14.892 INFORMATION: Erweiterung 'utilsplugin2' wird geladen (Version 34506)
2018-12-15 10:42:15.030 INFORMATION: Erweiterung 'HouseNumberTaggingTool' wird geladen (Version 34517)
2018-12-15 10:42:15.041 INFORMATION: Erweiterung 'opendata' wird geladen (Version 34698)
2018-12-15 10:42:15.144 INFORMATION: Erweiterung 'RoadSigns' wird geladen (Version 34553)
2018-12-15 10:42:15.253 INFORMATION: Erweiterung 'dataimport' wird geladen (Version 34575)
2018-12-15 10:42:15.271 INFORMATION: Erweiterung 'continuosDownload' wird geladen (Version 82)
2018-12-15 10:42:15.285 INFORMATION: Erweiterung 'pdfimport' wird geladen (Version 34576)
2018-12-15 10:42:15.303 INFORMATION: Erweiterung 'namemanager' wird geladen (Version 34532)
2018-12-15 10:42:15.306 INFORMATION: Erweiterung 'terracer' wird geladen (Version 34584)
2018-12-15 10:42:15.350 INFORMATION: Erweiterung 'wikipedia' wird geladen (Version v1.1.1)
2018-12-15 10:42:15.493 INFORMATION: Erweiterung 'PicLayer' wird geladen (Version 34544)
2018-12-15 10:42:15.535 INFORMATION: Erweiterung 'DirectUpload' wird geladen (Version 34502)
2018-12-15 10:42:15.542 INFORMATION: Erweiterung 'geojson' wird geladen (Version 87)
2018-12-15 10:42:15.564 INFORMATION: Erweiterung 'pbf' wird geladen (Version 34576)
2018-12-15 10:42:15.575 INFORMATION: Erweiterung 'photo_geotagging' wird geladen (Version 34576)
2018-12-15 10:42:15.610 INFORMATION: Erweiterung 'OpeningHoursEditor' wird geladen (Version 34535)
2018-12-15 10:42:15.635 INFORMATION: Erweiterung 'poly' wird geladen (Version 34546)
2018-12-15 10:42:15.639 INFORMATION: Erweiterung 'undelete' wird geladen (Version 34568)
2018-12-15 10:42:15.656 INFORMATION: Erweiterung 'buildings_tools' wird geladen (Version 34724)
2018-12-15 10:42:15.669 INFORMATION: Erweiterung 'Tracer2' wird geladen (Version 34564)
2018-12-15 10:42:15.866 INFORMATION: Erweiterung 'download_along' wird geladen (Version 34503)
2018-12-15 10:42:15.868 INFORMATION: Reassigning shortcut 'tools:download_along' from null to 576 because of conflict with Alt+Umschalt+D
2018-12-15 10:42:15.868 INFORMATION: Tastenkürzelkonflikt: 'tools:download_along' wurde von 'continuosdownload:activate' auf 'Alt+Umschalt+F1' verschoben.
2018-12-15 10:42:16.204 INFORMATION: RemoteControl::Accepting remote connections on /127.0.0.1:8111
2018-12-15 10:42:16.207 INFORMATION: RemoteControl::Accepting remote connections on /0:0:0:0:0:0:0:1:8111
2018-12-15 10:42:16.248 INFORMATION: RemoteControl::Accepting secure remote connections on /127.0.0.1:8112
2018-12-15 10:42:16.251 INFORMATION: RemoteControl::Accepting secure remote connections on /0:0:0:0:0:0:0:1:8112
2018-12-15 10:42:16.258 INFORMATION: Message notifier active (checks every 5 minutes)
2018-12-15 10:42:16.264 INFORMATION: Changeset updater active (checks every 60 minutes if open changesets have been closed)
2018-12-15 10:42:16.357 INFORMATION: GET http://www.openstreetmap.org/api/0.6/user/details (Anzahl der ungelesenen Nachrichten abrufen) -> 301 (345 B)
2018-12-15 10:42:16.358 INFORMATION: Herunterladen umgelenkt auf 'https://www.openstreetmap.org/api/0.6/user/details'
2018-12-15 10:42:16.612 INFORMATION: GET https://www.openstreetmap.org/api/0.6/user/details (Anzahl der ungelesenen Nachrichten abrufen) -> 200 (556 B)
2018-12-15 10:42:22.072 INFORMATION: Changeset updater inactive
2018-12-15 10:42:22.073 INFORMATION: Message notifier inactive
2018-12-15 10:42:22.073 INFORMATION: RemoteControl::Server /127.0.0.1:8111 stopped.
2018-12-15 10:42:22.074 INFORMATION: RemoteControl::Server /0:0:0:0:0:0:0:1:8111 stopped.
2018-12-15 10:42:22.075 INFORMATION: RemoteControl::Server /127.0.0.1:8112 stopped.
2018-12-15 10:42:22.075 INFORMATION: RemoteControl::Server /0:0:0:0:0:0:0:1:8112 stopped.
wambacher@server2:~/snapshots/2018$ 

don’t care about some errors listed here - i don’t :wink:

Regards
walter

What error are you actually getting, and on what operating system? To echo wambacher, I’d suggest installing OpenJDK, even on Windows, if that’s what you’re asking about.

On Windows 10 I downloaded it from http://jdk.java.net/11/ and unzipped it. I moved it somewhere sensible and unzipped it so that C:\Utils\openjdk-11_windows-x64_bin\jdk-11\bin (where I’d put it) was in the path.

josm was not installed so I installed it. This is the output:


josm
Using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to execute josm.
2018-12-18 02:26:17.246 INFO: Log level is at INFO (INFO, 800)
2018-12-18 02:26:17.951 INFO: Detected useable IPv6 network, preferring IPv6 over IPv4.
2018-12-18 02:26:20.882 INFO: GET https://josm.openstreetmap.de/wiki/StartupPage -> 200
Warning: Nashorn engine is planned to be removed from a future JDK release
2018-12-18 02:26:21.655 INFO: Update imagery 'Bing aerial imagery'
2018-12-18 02:26:21.655 INFO: Update imagery 'DigitalGlobe Premium Imagery'
2018-12-18 02:26:21.656 INFO: Update imagery 'DigitalGlobe Standard Imagery'
2018-12-18 02:26:21.656 INFO: Update imagery 'Esri World Imagery'
2018-12-18 02:26:21.656 INFO: Update imagery 'Esri World Imagery (Clarity) Beta'
2018-12-18 02:26:21.656 INFO: Update imagery 'Mapbox Satellite'
2018-12-18 02:26:21.657 INFO: Update imagery 'OpenStreetMap (Standard Black & White)'
2018-12-18 02:26:21.657 INFO: Update imagery 'OpenStreetMap Carto (Standard)'
2018-12-18 02:26:24.032 INFO: Defaults for imagery.generic.default_autozoom differ:  != true
2018-12-18 02:26:24.036 INFO: Defaults for imagery.generic.default_autoload differ:  != true
2018-12-18 02:26:24.036 INFO: Defaults for imagery.generic.default_showerrors differ:  != true
Warning: Nashorn engine is planned to be removed from a future JDK release
2018-12-18 02:26:24.186 WARNING: No configuration settings found.  Using hardcoded default values for all pools.
2018-12-18 02:26:24.285 WARNING: Region [TMS_BLOCK_v2] Resetting cache
2018-12-18 02:26:24.475 INFO: Changeset updater active (checks every 60 minutes if open changesets have been closed)

JOSM opend up a java OpenStreet Map Editor and it said I should update!

I tried osmosis using oracle java, installed both 8 and 11 and tried both with similar output.

The following is a list of my java options:

sudo update-alternatives --config javac
There are 3 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                          Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/javac   1111      auto mode
* 1            /usr/lib/jvm/java-11-openjdk-amd64/bin/javac   1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/bin/javac    1081      manual mode
  3            /usr/lib/jvm/java-8-oracle/bin/javac           1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javac to provide /usr/bin/javac (javac) in manual mode
ant@moon /opt/java/64/jre1.8.0_191/lib $ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
ant@moon /opt/java/64/jre1.8.0_191/lib $ sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      auto mode
  1            /opt/java/64/jre1.8.0_191/bin/java               1         manual mode
  2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
* 3            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
  4            /usr/lib/jvm/java-8-oracle/jre/bin/java          1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in manual mode
ant@moon /opt/java/64/jre1.8.0_191/lib $ sudo update-alternatives --config javac
ant@moon /opt/java/64/jre1.8.0_191/lib $ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-3ubuntu116.04ppa1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-3ubuntu116.04ppa1, mixed mode, sharing)


SomeoneElse, I am using Linux Mint 14.

I am using version ‘14460’ of JOSM.

The basic problem I get is when I try running osmosis:

bin/osmosis --read-xml file=california-latest.osm --write-apidb dbType="mysql" host="localhost" validateSchemaVersion=no database="OSM" user="root" password="mypwd"
Dec 18, 2018 2:33:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.47
Dec 18, 2018 2:33:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Dec 18, 2018 2:33:36 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Dec 18, 2018 2:33:36 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Dec 18, 2018 2:33:36 AM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to insert a new changeset for user with id -1.
	at org.openstreetmap.osmosis.apidb.v0_6.impl.ChangesetManager.addChangeset(ChangesetManager.java:139)
	at org.openstreetmap.osmosis.apidb.v0_6.impl.ChangesetManager.addChangesetIfRequired(ChangesetManager.java:154)
	at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1170)
	at org.openstreetmap.osmosis.xml.v0_6.impl.BoundsElementProcessor.end(BoundsElementProcessor.java:84)
	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.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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 java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:197)
	at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:90)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'changeset_id' in 'field list'
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:975)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1114)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1062)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1383)
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1047)
	at org.openstreetmap.osmosis.apidb.v0_6.impl.ChangesetManager.addChangeset(ChangesetManager.java:127)
	... 18 more

Dec 18, 2018 2:33:36 AM 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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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)


@greg: please post complete command line calling osmosis.

are you trying to access a mysql database?

regards
walter

The error message is “Unable to insert a new changeset for user with id -1”.

It’s nothing to do with drivers, but with fundamental referential integrity issues on the DB. Users must exist before they can write changesets. I think it would be worth knowing why you want to use an API database as it might not be the most appropriate schema for your task.

The complete line was part of the output. Other then the pw it is the same:

bin/osmosis --read-xml file=california-latest.osm --write-apidb dbType="mysql" host="localhost" validateSchemaVersion=no database="OSM" user="root" password="mypwd"

I am trying to import the osm data into mariadb using osmosis for a transit application.

You have to use the Mysql tasks: https://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.47#MySQL_Tasks

E.g. change “–write-apidb” to “–write-mysql”

Regards
walter


ant@moon /var/www/html/lookup_osm/osmosis $ bin/osmosis --read-xml file=california-latest.osm --write-mysql dbType="mysql" host="localhost" validateSchemaVersion=no database="OSM" user="root" password="mypwd"
Dec 18, 2018 6:55:14 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.47
Dec 18, 2018 6:55:14 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Dec 18, 2018 6:55:14 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type write-mysql 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:51)
	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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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)

It says that task type does not exist.

My goal is to import OSM data into Mariadb. It was suggested to use osmosis on the mariadb website. https://mariadb.com/kb/en/library/openstreetmap-dataset/. Ive spent almost a week trying to work this out. Would I be better off writing my own mariadb reader? I would rather not! Does anyone have a better solution or suggestion?

Thanks again.

I don’t know if this would cause the error you got, but the documentation doesn’t include a “dbType” option for --write-mysql. Maybe that just needs to be removed?

i found some more information on https://github.com/oschrenk/osmosis-mysql/blob/master/PROBLEMS.md Still dont know exactly what was done for them to run it. So maybe the answer is buried somewhere in that document.

By the way thanks for your help!

following the instructions on https://mariadb.com/kb/en/library/openstreetmap-dataset/ they said Version 0.36 is known to work,

The significant error in this output is SEVERE: Thread for task 1-read-xml failed. So does this mean there is a problem with the xml file, or perhaps is it too large? Maybe there is a java setting to increase xml read size, or maybe there is something else.

This is the output…

ant@moon /var/www/html/lookup_osm/osmosis/osmosis-0.36 $ bin/osmosis --read-xml file=california-latest.osm --write-apidb dbType="mysql" host="localhost" validateSchemaVersion=no database="OSM" user="root" password="mypwd"
Dec 19, 2018 2:19:20 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.36
Dec 19, 2018 2:19:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Dec 19, 2018 2:19:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Dec 19, 2018 2:19:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Dec 19, 2018 2:19:21 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to bulk insert nodes into the database.
	at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:577)
	at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1108)
	at org.openstreetmap.osmosis.core.container.v0_6.NodeContainer.process(NodeContainer.java:58)
	at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1082)
	at org.openstreetmap.osmosis.xml.v0_6.impl.NodeElementProcessor.end(NodeElementProcessor.java:117)
	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.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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 java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:197)
	at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:108)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`OSM`.`nodes`, CONSTRAINT `nodes_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`))
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
	at com.mysql.jdbc.Util.getInstance(Util.java:381)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2362)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2280)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2265)
	at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushNodes(ApidbWriter.java:575)
	... 19 more

Dec 19, 2018 2:19:21 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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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:31)


Calling the API-DB is defenitely wrong - please believe us.

The API-DB is used for processing changesets but not for OSM-Data.

Regards
walter

OK thanks wambacher. I tried using --write-mysql but that will not work for any version of osmosis/java I found, including the most recent. I was basing the usage off of an example on the mariadb osm site https://mariadb.com/kb/en/library/openstreetmap-dataset/. It looks like these types of osmosis issues have been risen for years and mysql/mariadb is not being supported. Its just time to give up on using osmosis for me.

Now I need to make an import tool for mariadb and I will need to understand the osm data schema. I hope it is not too difficult to understand. Any advice is welcome.

wambacher, this is what I get when using --write-mysql

ant@moon /var/www/html/lookup_osm/osmosis $ bin/osmosis --read-xml file=california-latest.osm --write-mysql dbType="mysql" host="localhost" validateSchemaVersion=no database="OSM" user="root" password="mypwd"
Dec 20, 2018 12:54:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.47
Dec 20, 2018 12:54:45 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Dec 20, 2018 12:54:45 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type write-mysql 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:51)
	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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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)