loading mapscript in java error
dbarron
dbarron at DSWLLC.COM
Tue Nov 9 10:53:26 PST 2004
Sean,
Using the patched mapgml.c and recompiling seems to have helped fix the problems I was seeing. It appears to be working right now and I just have some environment issues to work out.
For example if I do not specify the mapscript.jar on the java command line then the java command will only look in <java_home>/jre/lib/ext for it and I get an exception:
# java -verbose MapScriptTest
...
loading mapscript library...
mapscript library LOADED...
...
[Loaded edu.umn.gis.mapscript.mapObj from file:/usr/local/jdk1.5.0/jre/lib/ext/mapscript.jar]
[Loaded edu.umn.gis.mapscript.mapscriptJNI from file:/usr/local/jdk1.5.0/jre/lib/ext/mapscript.jar]
[Loaded java.lang.UnsatisfiedLinkError from shared objects file]
Exception in thread "main" java.lang.UnsatisfiedLinkError: new_mapObj
at edu.umn.gis.mapscript.mapscriptJNI.new_mapObj(Native Method)
at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:334)
at MapScriptTest.main(MapScriptTest.java:13)
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]
Then, if I export the CLASSPATH again and specify the jar file on the command line then I move beyond that error to an actual mapserver map file issue:
#export CLASSPATH
#java -verbose -classpath $CLASSPATH:/usr/local/lib/java/mapscript.jar MapScriptTest
...
loading mapscript library...
mapscript library LOADED...
...
[Loaded edu.umn.gis.mapscript.mapObj from file:/usr/local/lib/java/mapscript.jar]
[Loaded edu.umn.gis.mapscript.mapscriptJNI from file:/usr/local/lib/java/mapscript.jar]
[Loaded java.lang.UnknownError from /usr/local/jdk1.5.0/jre/lib/rt.jar]
Exception in thread "main" java.lang.UnknownError: Given map extent is invalid.
at edu.umn.gis.mapscript.mapscriptJNI.new_mapObj(Native Method)
at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:334)
at MapScriptTest.main(MapScriptTest.java:13)
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]
This tells me it is working - would you and Umberto agree? I'll bang on it more today and see where it leads me as well.
Thanks for all your efforts!
Dan
More information about the MapServer-users
mailing list