Problems in testing Java Mapscript
Umberto Nicoletti
umberto.nicoletti at GMAIL.COM
Mon Jun 4 11:17:48 PDT 2007
On 6/4/07, Gaia Trecarichi <gaia.trecarichi at gmail.com> wrote:
>
>
> Hello,
>
> I'm new in mapserver stuff and I'm trying to use Java Mapscript without any
> success.
>
> My environment is:
> Windows XP
> MS4W version 4.10.1.
> JDK 1.6.0_01
> Eclipse
>
>
> I wanted to test some Java Mapscript functionality with a simple Java
> program whose code is the following:
>
> -----------------------------------------------------------------------
>
> …
>
> import edu.umn.gis.mapscript.*;
>
> public class ProvaMapscript {
>
> public static void main(String[] args) {
>
> ….
>
> String mappath= new String("C:\\ms4w\\apps\\e-rescue\\" );
>
> mapObj map = new mapObj(mappath.concat(" emergency2.map"));
>
> imageObj image = map.draw();
>
> String image_url =
> "C:\\ms4w\\tmp\\ms_tmp\\emergency.png";
>
> image.save(image_url, map);
>
> …
>
> }
>
> }
>
> I get the following error:
>
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program
> Files\Java\jre1.6.0_01\bin\mapscript.dll: Can't find
> dependent libraries
>
> at java.lang.ClassLoader$NativeLibrary.load(Native
> Method )
>
> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>
> at java.lang.ClassLoader.loadLibrary(Unknown Source)
>
> at java.lang.Runtime.loadLibrary0(Unknown Source)
>
> at java.lang.System.loadLibrary(Unknown Source)
>
> at
> edu.umn.gis.mapscript.mapscriptJNI.<clinit>(mapscriptJNI.java:23
> )
>
> at edu.umn.gis.mapscript.mapObj.<init>( mapObj.java:276)
>
> at ProvaMapscript.main( ProvaMapscript.java:51)
>
> I don't know exactly which libraries mapscript.dll requires but as far as I
> could see from some forum the following list of dll's is needed:
>
> bgd.dll
>
> gdal14.dll
>
> geotiff.dll
>
> iconv.dll
>
> kernel32.dll
>
> libcurl.dll
>
> libecwj2.dll
>
> libmap.dll
>
> libmysql.dll
>
> libpq.dll
>
> libproj.dll
>
> libtiff.dll
>
> mapscript.dll
>
> msvcr71.dll
>
> msvcrt.dll
>
> ntdll.dll
>
> pdflib.dll
>
> proj.dll
>
> xerces-c_2_7.dll
>
> zlib1.dll
>
> dwmapi.dll
>
>
>
> I have them in the directory "C:\ms4w\Apache\cgi-bin" and this directory is
> in the system environment variable PATH.
>
>
>
> I don't know exactly which is the problem. I'm thinking to 2 things:
>
> 1- As far as I can understand there is a library, namely sde91.dll, that is
> needed by libmap.dll. I can't find this library in my system. Is there
> anybody who knows where I can download this library? (but I think I don't
> need it since I'm not using ESRI's ArcSDE)
>
Gaia,
what makes you think it's because of sde91.dll ? What tool have you
used to detect this is the missing dll in the dependency chain? Did
you use http://www.dependencywalker.com/ ?
Also, are you sure that eclipse is picking up the correct path and is
not using its internal default settings instead?
> 2- Is it possible that my Java Mapscript files are not compatible with my
> JDK version 1.6.0? I say it because I read in the README_INSTALL.txt of MS4W
> the following:
>
Java bytecode is always backwards compatible, so that is not a problem
or at least it's a very unlikely one.
BTW, the java geeks who live here would very much appreciate if you
turned off html formatting and reverted to posting in good ol' plain
text. Thanks ;-)
Hope this helps,
Umberto
> MapScript
>
> …
>
> Java MapScript: compiled against Java 1.5.07
>
> …
>
> If anybody could help me in this problem I would be infinitely grateful!!
>
> Thank you in advance,
>
> Gaia
More information about the MapServer-users
mailing list