2

I'm trying to use open street map's 'osmosis' tool to parse an osm file and write to a postgis database.

(if it's helpful, i'm running this on ubuntu 11.10, and I have the oracle jdk 1.6 on my system)

Here's what I've been attempting.

[../package] $ ./bin/osmosis --read-xml file="../../../osm_dumps/africa.osm" --write-pgsql host=localhost database=osmosis_test user=chris
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.classworlds.Launcher.  Program will exit.
[../package] $ ls -al /etc/alternatives/java
lrwxrwxrwx 1 root root 37 2012-01-12 19:16 /etc/alternatives/java -> /usr/lib/jvm/jdk1.6.0_30/jre/bin/java
[../package] $ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
4
  • 1
    It seems some classpath issue. I am not expert in osmosis or linux, but from error we can say it is because of either 1) Missing required jar/class file in classpath 2) You might have duplicate jar/class files in classpath.
    – kosa
    Jan 13, 2012 at 19:03
  • thinksteep - Can i do anything to check on those possibilities? Jan 13, 2012 at 19:06
  • Make sure jars in classpath has that perticular class org/codehaus/classworlds/Launcher. If it is not your own class, google may help you in finding out which jar has this class file. Make sure that jar is in classpath. If jar is classpath, make sure there is no other jar with same class in classpath.
    – kosa
    Jan 13, 2012 at 19:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.