<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Verdana">Greetings,<br>
<br>
I've compiled a Mapserver from the latest CVS code (Sept 29) and I'm
having some problems with Java Mapscript. <br>
<br>
My system had been running fine until </font></font><font size="-1"><font
face="Verdana">this afternoon, when </font></font><font size="-1"><font
face="Verdana">I compiled a new Mapserver from CVS code. I had to
compile a new Swig version before I could start. <br>
<br>
The Mapserver compilation was fine, and I didn't get any erros. My
goal was the Java Mapscript, wich was sucessfully compiled and tested
with "make test". After I had deployed and restarted the Tomcat it
figured out that one of my example codes wasn't working anymore. The
code is very simple, please take a look : <br>
<br>
</font></font>
<blockquote><font face="Courier New, Courier, monospace" size="-1">
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {<br>
log.trace("doGet - request:" + req);<br>
try {<br>
PrintWriter p = resp.getWriter();<br>
<br>
mapObj mapa = new
mapObj("/home2/java/tomcat/webapps/mapserver_wms/mapas/rio_grande_do_sul.map");<br>
<b>
mapa.setMappath("/home2/java/tomcat/webapps/mapserver_wms/mapas/shapes_rio_grande_do_sul");</b><br>
<br>
imageObj image = mapa.draw();<br>
<br>
File arqMapa = File.createTempFile("mapa", ".png", new
File("/home2/java/tomcat/webapps/mapserver_wms/image"));<br>
log.debug("createTempFile " + arqMapa.getAbsolutePath());<br>
<br>
arqMapa.deleteOnExit();<br>
image.save(arqMapa.getAbsolutePath(), mapa);<br>
<br>
resp.setContentType("text/html");<br>
resp.getWriter().println("<img src=image/" + arqMapa.getName()
+ ">");<br>
}<br>
catch (Exception e) {<br>
log.error(e.getLocalizedMessage(), e);<br>
}<br>
}</font><font size="-1"><font face="Verdana"></font></font><br>
</blockquote>
<font size="-1"><font face="Verdana"><br>
After I executed the code above on Firefox, the following error was
showed : <br>
</font></font>
<blockquote><font size="-1"><font face="Courier New, Courier, monospace">javax.servlet.ServletException:
set_mapObj_mappath<br>
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:293)<br>
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)<br>
<br>
root cause<br>
<br>
java.lang.UnsatisfiedLinkError: set_mapObj_mappath<br>
edu.umn.gis.mapscript.mapscriptJNI.set_mapObj_mappath(Native Method)<br>
edu.umn.gis.mapscript.mapObj.setMappath(mapObj.java:195)</font></font><br>
</blockquote>
<font size="-1"><font face="Verdana">After some tests I found that the
problem had been caused by </font></font><font
face="Courier New, Courier, monospace" size="-1"><b>mapa.setMappath </b></font><font
size="-1"><font face="Verdana">code. It seems Swig wasn't able to
create a proper mapscript.jar/libmapscript.so. I checked the
mapscript_wrap.c and the corresponding method to mapa.setMappath was
called Java_edu_umn_gis_mapscript_mapscriptJNI_mapObj_<b>1</b>mappath_<b>1</b>set.
Although I have definitely no experience with Swig, those numbers "1"
in method name doesn't look ok. Is it ok? Could be the Swig the
responsible for this error?</font></font><br>
<font size="-1"><font face="Verdana"><br>
If I remove the mapa.setMappath, everything works fine and my map is
shown in the browser.<br>
<br>
I included some info about my Mapserver and system. By the way, I've
compiled every component of Mapserver instead of using Linux defaults.<br>
<br>
<br>
</font></font><font size="-1"><font face="Verdana"><b>compiled packages
</b>(we haven't used any RPMs, all packages were manually
compiled/installed)<b><br>
</b></font></font>libpng-1.2.12<br>
freetype-2.2.1<br>
zlib-1.2.3<br>
gd-2.0.33<br>
jpegsrc.v6b<br>
tiff-3.8.2<font size="-1"><font face="Verdana"><br>
</font></font>libgeotiff-1.2.1<br>
PDFlib-Lite-6.0.3<br>
proj-4.4.9<br>
curl-7.15.4<br>
geos-2.2.3<br>
gdal-1.3.2<br>
swig-1.3.29<br>
<br>
<font size="-1"><font face="Verdana"><b>Mapserver's configure </b><br>
./configure --prefix=/home2/mapserver --without-pdf --with-threads
--with-zlib=/home2/mapserver/zlib --with-png=/home2/mapserver/libpng
--with-tiff=/home2/mapserver/libtiff
--with-jpeg=/home2/mapserver/libjpeg
--with-freetype=/home2/mapserver/freetype
--with-proj=/home2/mapserver/proj4
--with-geos=/home2/mapserver/geos/bin/geos-config
--with-gd=/home2/mapserver/gd
--with-ogr=/home2/mapserver/gdal/bin/gdal-config
--with-gdal=/home2/mapserver/gdal/bin/gdal-config
--with-curl-config=/home2/mapserver/libcurl/bin/curl-config --with-wfs
--with-wcs --with-wmsclient --with-wfsclient --with-php=/usr/include/php<br>
</font></font><font size="-1"><font face="Verdana"><br>
<b>Linux</b><br>
Linux dgtad 2.6.9-22.EL #1 Mon Sep 19 18:20:28 EDT 2005 i686 athlon
i386 GNU/Linux<br>
<br>
MAPSERVER_HOME=/home2/mapserver<br>
PROJ_LIB=$MAPSERVER_HOME/proj4/share/proj<br>
LD_LIBRARY_PATH=$LD_LIBRARY_<a class="moz-txt-link-freetext" href="PATH::/home2/mapserver/proj4/lib:/home2/mapserver/gdal/lib:/home2/mapserver/geos/lib:/home2/mapserver/libcurl/lib:/home2/mapserver/libpng/lib:/home2/mapserver/libjpeg/lib:/home2/mapserver/libtiff/lib:/home2/mapserver/libgeotiff/lib:/home2/mapserver/ogdi/lib:/home2/mapserver/freetype/lib:/home2/mapserver/gd/lib:/home2/mapserver/zlib/lib:/home2/mapserver/proj4/share/proj">PATH::/home2/mapserver/proj4/lib:/home2/mapserver/gdal/lib:/home2/mapserver/geos/lib:/home2/mapserver/libcurl/lib:/home2/mapserver/libpng/lib:/home2/mapserver/libjpeg/lib:/home2/mapserver/libtiff/lib:/home2/mapserver/libgeotiff/lib:/home2/mapserver/ogdi/lib:/home2/mapserver/freetype/lib:/home2/mapserver/gd/lib:/home2/mapserver/zlib/lib:/home2/mapserver/proj4/share/proj</a></font></font><font
size="-1"><font face="Verdana">:$MAPSCRIPT_HOME</font></font><br>
<font size="-1"><font face="Verdana">MAPSCRIPT_HOME=$MAPSERVER_HOME/mapscript<br>
PATH=/usr/java/jre/bin:/usr/java/jdk/bin:$MAPSCRIPT_HOME<br>
<br>
<b>Java<br>
</b>JRE_HOME=/usr/java/jre<br>
JAVA_HOME=/usr/java/jdk<br>
JDBC_HOME=/usr/java/jdbc<br>
CATALINA_HOME=/usr/java/tomcat<br>
<br>
java version "1.5.0_07"<br>
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)<br>
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)<br>
<br>
<b>Tomcat</b><br>
Using CATALINA_BASE: /usr/java/tomcat<br>
Using CATALINA_HOME: /usr/java/tomcat<br>
Using CATALINA_TMPDIR: /usr/java/tomcat/temp<br>
Using JRE_HOME: /usr/java/jre<br>
Server version: Apache Tomcat/5.5.17<br>
Server built: Apr 14 2006 02:08:29<br>
Server number: 5.5.17.0<br>
OS Name: Linux<br>
OS Version: 2.6.9-22.EL<br>
Architecture: i386<br>
JVM Version: 1.5.0_07-b03<br>
JVM Vendor: Sun Microsystems Inc.<br>
<br>
<b>gcc</b><br>
</font></font><font size="-1"><font face="Verdana">gcc (GCC) 3.4.4
20050721 (Red Hat 3.4.4-2)<br>
Copyright (C) 2004 Free Software Foundation, Inc.<br>
This is free software; see the source for copying conditions. There is
NO<br>
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.<br>
<br>
<b>Swig</b><br>
SWIG Version 1.3.29<br>
Compiled with g++ [i686-pc-linux-gnu]<br>
Please see <a class="moz-txt-link-freetext" href="http://www.swig.org">http://www.swig.org</a> for reporting bugs and further
information<br>
<br>
<br>
</font></font><font size="-1"><font face="Verdana">I'd appreciate any
help and thanks in advance.<br>
<br>
Best regards,<br>
</font></font><font size="-1"><font face="Verdana"><br>
</font></font>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title></title>
<font color="#000000" face="Verdana, Helvetica, Arial" size="1"><font
color="#000000" size="2"><b>José Vilson de Mello de Farias</b> </font><br>
<font color="#606060"><i><big>Analista de Sistemas<br>
</big></i></font></font><i style="color: rgb(96, 96, 96);"><font
size="-2">SSE - Segurança Pública</font></i><br>
<font color="#000000" face="Verdana, Helvetica, Arial" size="1"><br>
<font color="#000080"><b>DÍGITRO TECNOLOGIA</b></font><br>
<font color="#000000"><b>E-mail:</b> </font><a
href="mailto:vilson.farias@digitro.com.br%20"><font color="#606060">vilson.farias@digitro.com.br</font></a><br>
</font><font color="#000000" face="Verdana, Helvetica, Arial" size="1"><font
color="#000000"><b>Messenger: </b></font></font><font color="#000000"
face="Verdana, Helvetica, Arial" size="1"><a
href="mailto:vilson.farias@digitro.com.br%20"><font color="#606060">vilsonfarias@hotmail.com</font></a></font><br>
<font color="#000000" face="Verdana, Helvetica, Arial" size="1"><!--<font color = #000000> <b>ICQ:</b></font>
<font color = #000000> 11866179</font><br>
!--><font
color="#000000"><b>Fone:</b></font> <font color="#000000">(0xx48)
3281-7314</font><br>
<font color="#000000"><b>Fax:</b></font> <font color="#000000">(0xx48)
3281-7000</font><br>
<font color="#000000"><b>Site:</b></font> <a
href="http://www.digitro.com.br%20"><font color="#000000">www.digitro.com.br</font></a><a
href="http://www.digitro.com.br%20"> </a></font>
</div>
</body>
</html>