a more recent osmosis is needed in order to process current Openstreetmap data. Reproducible: Always Steps to Reproduce:
Created attachment 233557 [details] ebuild I was working on I tried to make a new ebuild. But I don't know how to write it propperly. Perhaps someone else could finish it. The dependencies are taken from the ivy.xml included in the osmosis source package. The ebuild DOES NOT WORK (yet)
This ebuild works: http://gpo.zugaina.org/AJAX/Ebuild/2118478/View
OK it compiles yes, but it doesn't run. The Error is: java.lang.NoClassDefFoundError: org/java/plugin/PluginLifecycleException so some java library is not found. I guess this could be either: Because dependencies are downloaded by ivy, but then not installed. Or: Osmosis comes with its own runs cript. And I have no idea how to get this script (or parts of it) into the gentoo launcher.
I can confirm this error message. The pre-built osmosis (installed to /opt/osmosis/osmosis-0.35.1) runs a helper script, which executes java -cp /opt/osmosis/osmosis-0.35.1/lib/default/plexus-classworlds-2.2.2.jar -Dapp.home=/opt/osmosis/osmosis-0.35.1 -Dclassworlds.conf=/opt/osmosis/osmosis-0.35.1/config/plexus.conf org.codehaus.classworlds.Launcher I do not know the difference between plexus-classworlds (bug #174995) and the dev-java/classworlds ebuild. The launcher/helper script can be found in the osmosis source package at bin/osmosis and the config is at config/plexus.conf
This does not work either: java -cp /usr/share/classworlds-1/lib/classworlds.jar -Dapp.home=/var -Dclassworlds.conf=/opt/osmosis/osmosis-0.35.1/config/plexus.conf org.codehaus.classworlds.Launcher Exception in thread "main" java.lang.NullPointerException at org.codehaus.classworlds.Configurator.loadGlob(Configurator.java:363) at org.codehaus.classworlds.Configurator.configure(Configurator.java:233) at org.codehaus.classworlds.Launcher.configure(Launcher.java:181) at org.codehaus.classworlds.Launcher.main(Launcher.java:457)
classworlds is supposed to load all necessary jars definded in plexus.conf, contents of plexus.conf: main is org.openstreetmap.osmosis.core.Osmosis from osmosis.core [osmosis.core] load ${app.home}/lib/*.jar load ${app.home}/lib/default/*.jar load ${app.home}/osmosis.jar ls /opt/osmosis/osmosis-0.35.1/lib/*.jar No such file or directory ls /opt/osmosis/osmosis-0.35.1/lib/default/*.jar /opt/osmosis/osmosis-0.35.1/lib/default/aopalliance-1.0.jar /opt/osmosis/osmosis-0.35.1/lib/default/commons-codec-1.4.jar /opt/osmosis/osmosis-0.35.1/lib/default/commons-compress-1.0.jar /opt/osmosis/osmosis-0.35.1/lib/default/commons-dbcp-1.2.2.jar /opt/osmosis/osmosis-0.35.1/lib/default/commons-logging-1.1.1.jar /opt/osmosis/osmosis-0.35.1/lib/default/commons-pool-1.3.jar /opt/osmosis/osmosis-0.35.1/lib/default/jpf-1.5.jar /opt/osmosis/osmosis-0.35.1/lib/default/mysql-connector-java-5.1.10.jar /opt/osmosis/osmosis-0.35.1/lib/default/plexus-classworlds-2.2.2.jar /opt/osmosis/osmosis-0.35.1/lib/default/postgis-jdbc-1.3.3.jar /opt/osmosis/osmosis-0.35.1/lib/default/postgresql-8.3-603.jdbc4.jar /opt/osmosis/osmosis-0.35.1/lib/default/spring-beans-2.5.6.SEC01.jar /opt/osmosis/osmosis-0.35.1/lib/default/spring-context-2.5.6.SEC01.jar /opt/osmosis/osmosis-0.35.1/lib/default/spring-core-2.5.6.SEC01.jar /opt/osmosis/osmosis-0.35.1/lib/default/spring-jdbc-2.5.6.SEC01.jar /opt/osmosis/osmosis-0.35.1/lib/default/spring-tx-2.5.6.SEC01.jar /opt/osmosis/osmosis-0.35.1/lib/default/stax2-api-3.0.1.jar /opt/osmosis/osmosis-0.35.1/lib/default/woodstox-core-lgpl-4.0.3.jar /opt/osmosis/osmosis-0.35.1/lib/default/xercesImpl-2.9.1.jar Using the prebuilt osmosis with java-dev/classworlds is fine: java -cp /usr/share/classworlds-1/lib/classworlds.jar -Dapp.hom e=/opt/osmosis/osmosis-0.35.1/ -Dclassworlds.conf=/opt/osmosis/osmosis-0.35.1/config/plexus.conf org.codehaus.classworlds.Launcher hope that helps
I am not sure if this is the right way to launch osmosis, maybe someone could comment on it. CLASSPATH="${CLASSPATH}:$(java-config --classpath classworlds-1)" java -Dclassworlds.conf=osmosis.conf org.codehaus.classworlds.Launcher osmosis.conf needs to have this content: ---------- snip ---------- main is org.openstreetmap.osmosis.core.Osmosis from osmosis.core [osmosis.core] load /path/to/.../$dependency.jar load /usr/share/osmosis/lib/osmosis.jar ---------- snap ---------- All paths for this config file can be obtained as in this example: java-config --classpath osmosis I did not figure out the Gentoo names of the dependencies listed in comment #6 yet. java-config --list-available-packages shows some of them, but I think there are dependencies missing in this ebuild.
Sorry for taking so long to respond. Yes there are definitely dependencies missing. For example commons-compress-1.0.jar, which I couldn't find in the portage tree I could run osmosis with the commandline suggested in comment #7 with following osmosis.conf: ---------- snip ---------- main is org.openstreetmap.osmosis.core.Osmosis from osmosis.core [osmosis.core] load /usr/share/jpf-1.5/lib/jpf.jar load /usr/share/commons-logging/lib/commons-logging.jar load /usr/share/osmosis/lib/osmosis.jar load /usr/share/classworlds-1/lib/classworlds.jar load /usr/share/aopalliance-1/lib/aopalliance.jar load /usr/share/commons-codec/lib/commons-codec.jar load /home/[...]/osmosis-0.35.1/lib/default/commons-compress-1.0.jar ---------- snap ---------- the last entry points to a library which was downloaded by ivy, the one I couldn't find in portage. Also a problem would be, how to get these path names reliably during compile or runtime in gentoo.
I can confirm the osmosis.conf in comment #8. I will attach a script to generate the configuration, it might be used at runtime (maybe it is too slow, will the paths ever change?). The dependecy dev-java/commons-compress is missing (bug #172791), there is a static path in the script for now.
Created attachment 238443 [details] script to create osmosis.conf
Guys does the osmosis 0.35.1 that i added to main tree work for you? I am not exactly fond of java ebuild processes or packaging java things so i cant exactly ensure that it will work peachy :(
(In reply to comment #11) > Guys does the osmosis 0.35.1 that i added to main tree work for you? Well, I'm currently using binary package of latest version (0.39), because I need the ability to read/write pbf files. 0.35.1 is pretty old, it would be great to get the portage ebuilds up to date.
No, actual ebuild did not work. The error is: 06-oct-2011 20:13:42 org.openstreetmap.osmosis.core.Osmosis run INFO: Osmosis Version 0.35.1 06-oct-2011 20:13:42 org.openstreetmap.osmosis.core.Osmosis main GRAVE: Execution aborted. java.lang.NoClassDefFoundError: org/java/plugin/JpfException at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:73) at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:30) Caused by: java.lang.ClassNotFoundException: org.java.plugin.JpfException 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)
(In reply to comment #11) > Guys does the osmosis 0.35.1 that i added to main tree work for you? I think it's on the right way, but the loading mechanism does not work for me either. Same error as cruzki reported I tried to add jpf as a dependency, and added java-pkg_register-dependency jpf-1.5 to the ebuild, but the error stays there. The problem is that somosis is oriented towards "working out of the box" for people who checkout the git repo. So ivy downloads all the necessary dependencies. Something which has to be done exactly the other way round for a distribution. Also comment from the developer: http://lists.openstreetmap.org/pipermail/osmosis-dev/2011-November/001153.html "If you want to create a distribution specific build for Osmosis you won't be able to use the existing ant build, it is highly coupled to the Ivy dependency management framework which downloads dependent jar files from the Internet."
*** Bug 470586 has been marked as a duplicate of this bug. ***
*** Bug 402945 has been marked as a duplicate of this bug. ***
*osmosis-0.35.1 (01 Jun 2011) 01 Jun 2011; Tomáš Chvátal <scarabeus@gentoo.org> +osmosis-0.35.1.ebuild, -osmosis-0.39.ebuild: Downgrade to 0.35.1 which is latest source release upstream made.