Using mapserv as a dynamic link library from a servlet

Stephen Lime steve.lime at dnr.state.mn.us
Wed Mar 21 17:24:47 EST 2001


Mapserv itself is built for CGI-only. You'd have better luck trying to develop java version
of MapScript and then build servlets from that. I think I'd need to add a method to make
a copy of a loaded mapObj that could be used with each request and then destroyed.

Swig 1.3a will kick out JNI code and I've gone so far as to get the shared library compiled.
I ran into problems compiling the class specific (i.e. layerObj, classObj) code into class
files. I just screwed around for an hour or so and didn't work at it much.

I'd love to see this work and will gladly try to accomodate code changes necessary to
make it happen.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Wakely, Matthew" <Matthew.Wakely at dsto.defence.gov.au> 03/21/01 03:43PM >>>
Has anyone tried to convert mapserv to a .dll file and then call it using a
java Servlet and Java Native Interface.

My problem is that the mapserv program only seems to run once. Usually this
would be ok because CGI programs run once then die. However I cant do that
from a servlet.
Basicly all i did was convert the main() function in mapserv.c to a function
"callMapserv()" i could call from Java. The problem is that the program
seems to crash when it tries to parse using maplexxer.c and mapparser.c.

Has anyone encountered these problems before or could someone perhaps offer
some advice. I suspect its because of all the global variables flying around
within mapserv.




More information about the mapserver-users mailing list