JavaMapScript

Roger Bixby roger at ROGERBIXBY.COM
Mon Nov 14 23:04:22 EST 2005


Hi all,

I'm trying to use the JavaMapScript package and have run into some difficulty. 
When I run the DrawMap test file included with the distribution I get two 
different errors.

This first error I get when I reference a map file that is not in the same 
directory as the java class file:

C:\eclipse\workspace\tekmaps\.deployables\tekmaps\WEB-INF\classes>java 
-Djava.library.path=c:/mapscript -cp 
.;c:/tekmaps/mapscript/debug/java/mapscript.jar DrawMap example1-8.map map.jpg
Exception in thread "main" java.lang.UnknownError: No such file or directory
         at edu.umn.gis.mapscript.mapscriptJNI.new_mapObj(Native Method)
         at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:328)
         at DrawMap.main(DrawMap.java:34)

The second is slightly different, but I suspect it's related to the first:

If I put the map file, in this case example1-8.map in the classpath, I sometimes 
get a java IOException:

C:\eclipse\workspace\tekmaps\.deployables\tekmaps\WEB-INF\classes>java 
-Djava.library.path=c:/mapscript -cp 
.;c:/tekmaps/mapscript/debug/java/mapscript.jar DrawMap example1-8.map map.jpg
(example1-8.map)java.io.IOException: (example1-8.map)
         at edu.umn.gis.mapscript.mapscriptJNI.new_mapObj(Native Method)
         at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:328)
         at DrawMap.main(DrawMap.java:34)

I can't find any documentation on these errors at all. What little documentation 
I have been able to find is a couple of years old. Is there anyone out there now 
using Java MapScript who can steer me in the right direction with this?

Thanks,

Roger Bixby



More information about the mapserver-users mailing list