0

I am a newbie to GIS, coming from a strict MIS background. Anyway, I have been having a little challenge for the past couple of days trying to import tiles and pyramids into my database. Using a tutorial I found here. Whenever I run this command on windows (8.1);

java -jar <your_geoserver_install_dir>/webapps/geoserver/WEB-INF/lib/gt-imagemosaic-jdbc-{version}.jar import -config <your geoserver data dir>/coverages/osm.postgis.xml -spatialTNPrefix tileosm -tileTNPrefix tileosm -dir tiles -ext png

I get this exception

java.lang.ClassNotFoundException: org.postgresql.Drive at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.geotools.gce.imagemosaic.jdbc.Import.start(Import.java:366) at org.geotools.gce.imagemosaic.jdbc.Toolbox.main(Toolbox.java:46)

I have already copied the postgressql driver jar file to my java runtime, lib/ext directory. which is found here; C:\java\jre7\lib\ext. I have also tried to write a java program to test for the driver and it works fine, and by the way I also have Netbeans(8.0.2) installed and the driver is working fine in there too. But I don't know why I still get that exception.

1

Maybe you can try this:

java -Xbootclasspath/a:<location of jdbc.jar> -jar <your_geoserver_install_dir>/webapps/geoserver/WEB-INF/lib/gt-imagemosaic-jdbc-{version}.jar import  -config <your geoserver data dir>/coverages/osm.postgis.xml -spatialTNPrefix tileosm -tileTNPrefix tileosm -dir tiles -ext png

I solved this problem via this method. And you can see the tutorial here.

| improve this answer | |
0

For ubuntu (at least 18.04) the following can work:

sudo apt install libpostgresql-jdbc-java cd /usr/share/java sudo ln -s postgresql.jar postgresql-jdbc.jar

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.