Issue with Mapscript in Java

Jean-Henry Berevoescu bjh at GLOBEXPLORER.COM
Wed Nov 22 15:00:26 EST 2006


Most probably you forgot to add mapscript.jar to the CLASSPATH
Also, for the DLL problem you had before, I would recommend
relaying on platform independent mechanisms, i.e. copying the DLL
to a directory one assumes might be in the library loading path is
not a sure bet and it definitely would not apply for any platform -
one should use "-Djava.library.path=..." for this kind of situation.

Jean


Francesco Martinelli wrote:
> 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.
>
>
> -------------------------------------------------------
> Click link below if it is SPAM bjh at globexplorer.com
> "https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=4564a8b2227114356172766&user=bjh@globexplorer.com&retrain=spam&template=history&history_page=1"
> !DSPAM:4564a8b2227114356172766!
> -------------------------------------------------------
>
>
>
>   


-- 
Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



More information about the mapserver-users mailing list