NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Running the most basic of Osmosis commands to extract data from a PBF file gives me a java.lang.VerifyError. Googling suggests this may be due to having the wrong libraries in the CLASSPATH. Where do I start to try abnd fix this?

Stacktrace below:

$ osmosis --read-pbf file=buckinghamshire-latest.osm.pbf --write-null
Jan 15, 2017 5:08:20 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.45
Jan 15, 2017 5:08:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Jan 15, 2017 5:08:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Jan 15, 2017 5:08:21 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Jan 15, 2017 5:08:21 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.VerifyError: class org.openstreetmap.osmosis.osmbinary.Fileformat$BlobHeader overrides final method isInitialized.()Z
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:332)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:43)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:208)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:202)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockHead.readHead(FileBlockHead.java:57)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.java:130)
        at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(BlockInputStream.java:34)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)
        at java.lang.Thread.run(Thread.java:745)

Jan 15, 2017 5:08: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 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:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:328)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

I'm using Java 1.8.0_111 on an OSBoxes Ubuntu 16.10 VM and installed using apt-get.

$ java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.10.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

$ uname -a
Linux osboxes 4.8.0-26-generic #28-Ubuntu SMP Tue Oct 18 14:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ dpkg -l osmosis
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version       Architecture  Description
+++-=================-=============-=============-=======================================
ii  osmosis           0.45-2        all           Command line OpenStreetMap data process

asked 15 Jan '17, 17:12

Mat_B's gravatar image

Mat_B
11113
accept rate: 0%

edited 15 Jan '17, 19:59

Did you build from source and which JRE and version do you have installed?

(15 Jan '17, 19:53) SimonPoole ♦

Details added above. Installed from package JRE 1.8

(15 Jan '17, 19:59) Mat_B

As just another data point, that version of Java works just find for me on 16.04 (locally installed off a server CD). Same JDK, older osmosis:

java -version

openjdk version "1.8.0_111" OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14) OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

osmosis --read-pbf file=derbyshire-latest.osm.pbf --write-null (snip - no errors) Jan 15, 2017 9:39:41 PM org.openstreetmap.osmosis.core.Osmosis run INFO: Total execution time: 6654 milliseconds.

dpkg -l osmosis

Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii osmosis 0.44.1-4 all Command line OpenStreetMap data p

(15 Jan '17, 21:44) SomeoneElse ♦

Note this is just me guessing. I don't believe that osmosis has a dependency outside of the standard Java classes so this might be a subtle incompatibility between oracles jdk and openjdk, I would suggest compiling from source.

permanent link

answered 15 Jan '17, 23:28

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×252

question asked: 15 Jan '17, 17:12

question was seen: 2,578 times

last updated: 15 Jan '17, 23:28

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum