Issue with Mapscript in Java

Francesco Martinelli martinelli at PI.INGV.IT
Wed Nov 22 14:06:09 EST 2006


Hi,
I have a problem about the use of MapServer from a Java program.
I am using the following environment:
-) NetBeans IDE 5.0
-) Windows
-) I also added the "mapscript.jar" file to the project Libraries,
extracted from "ms4w_1.5.1.zip" and in the "MANIFEST.MF" is reported:
Manifest-Version: 1.0
Created-By: 1.5.0_06 (Sun Microsystems Inc.)

With this set up on NetBeans I compiled succesfully.
When I tried running the program I got a first issue at the following line:
   mapObj myMap = new mapObj("mapFile.map");

The error was:
java.lang.UnsatisfiedLinkError: no mapscript in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at edu.umn.gis.mapscript.mapscriptJNI.<clinit>(mapscriptJNI.java:22)
        at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:312)

To try solving this issue I copied the file "mapscript.dll" (found in the
same directory as "mapscript.jar") in the project directory
"project\build\web\WEB-INF\classes",
but still I have an error on the same line, thought different:
java.lang.NoClassDefFoundError
        at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:312)

I am sure this is a configuration issue, but I didn't find any help
on-line on how-to configure the library to work with Java.
Is there anyone could help me?

Thank you,
Francesco Martinelli.



More information about the mapserver-users mailing list