Java Mapscript

Ryan Ollerenshaw ollerery at ENGR.ORST.EDU
Thu Aug 3 14:24:32 EDT 2006


I am trying to use MapServer's java Mapscript and keep getting the 
following error:

Java.lang.UnsatisfiedLinkError: no mapscript in java.library.path

I have added mapscript.jar to my WEB-INF/lib directory, but i am not 
sure what else i should do.  I am using eclipse with the Tomcat plug in, 
so i have also added the .jar file to eclipse but i dont think that 
makes a difference when using tomcat.

Here is my java code:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import edu.umn.gis.mapscript.*;

public class MapServerTest extends HttpServlet {

    public void doGet ( HttpServletRequest request, HttpServletResponse 
response )
        throws ServletException, IOException    {

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
       
        System.loadLibrary("mapscript");

        out.println("<html>");
        out.println("<head><title>Hello World!</title></head>");
        out.println("<body>");
        out.println("<h1>aa Hello, World !</h1>");
       
        //mapObj map = new 
mapObj("var/www/html/mapserver/htdocs/display.map");
    }// end doGet

}///:~



More information about the mapserver-users mailing list