loading mapscript in java error
Umberto Nicoletti
unicoletti at PROMETEO.IT
Tue Nov 9 23:56:36 PST 2004
On Tue, 2004-11-09 at 19:53, dbarron wrote:
> 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]
at this point java is loading mapscript classes from
/usr/local/jdk1.5.0/jre/lib/ext/mapscript.jar
Could it be that you have and old (I presume) version of mapscript
around?
However the UnsatisfiedLinkError means that the mapscript.jar refers to
, well, a Linker error :-) (the linker cannot locate functions in the
shared library).
Make triple sure you do not have old mapscript.jar or .so around. Also
check your environ.
> [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.
>
Yes, it is working. Correct extents in your map.
Regards,
Umberto
> Thanks for all your efforts!
>
> Dan
More information about the MapServer-users
mailing list