Using MapServer with java on Windows OS

Francesco Martinelli martinelli at PI.INGV.IT
Mon Dec 4 06:50:21 EST 2006


Dear friends,
I am trying to run a simple demo of MapServer using Java
on a Windows XP Professional operating system, but unsuccesfully.

Is anyone working on this system and using java with MapServer,
or knowing of any issue I should work around before going ahead?
Below are some of the details of my test, but please ask if I missed
something could be usefull.

Thank you for any help,
Francesco.

=============================================
I am using the package "ms4w_1.5.1.zip".

The demo program is very basic:

import edu.umn.gis.mapscript.mapObj;
public class DemoMain {
  private mapObj _map = null;
  public DemoMain() {
    try {
      String mapFile = "tutor.map";
      _map = new mapObj(mapFile);
    }
    catch (Throwable ex) {
      ex.printStackTrace();
    }
  }
  public static void main(String[] args) {
    try {
      DemoMain test = new DemoMain();
    } catch (Throwable ex) {
      ex.printStackTrace();
    }
  }
}

Now I compiled it succesfully, then I copied the "dll" files I identified
as necessary starting from mapscript.dll (using "depender.exe") in the
"TestUML" subdirectory and then run the program.
The files in TestUML are:
-) bgd.dll
-) gdal13.dll
-) geotiff.dll
-) iconv.dll
-) libcurl.dll
-) libecwj2.dll
-) libmap.dll
-) libmysql.dll
-) libpg.dll
-) libtiff.dll
-) mapscript.dll
-) pdflib.dll
-) proj.dll
-) xerces-c_2_7.dll
-) zlib1.dll

The command line to run the program is:
>java -classpath .\;.\mapscript.jar -Djava.library.path=.\TestUML\ DemoMain

The result was:
1) An error window reporting that "bgd.dll" was not found
2) the following lines after the command line:
java.lang.UnsatisfiedLinkError: C:\Demo\TestUML\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:22)
        at edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:312)
        at DemoMain.<init>(DemoMain.java:9)
        at DemoMain.main(DemoMain.java:20)

Thank you again for your time,
Francesco.



More information about the mapserver-users mailing list