<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Umberto,<br>
<br>
Indeed, there was an extra mapscript.jar in the Tomcat share/lib
directory. I've changed it's content and now everything is working
perfectly. I really appreciated your help, thanks a lot. <br>
<br>
You should keep the mapObj.setMappath test for the next source
release. It may help people who have the same problem.<br>
<br>
Best regards, <br>
<br>
Vilson<br>
<br>
Umberto Nicoletti wrote:
<blockquote
cite="mid75b4b93e0610030001s6b37fab4ja74e2b4020f32f0e@mail.gmail.com"
type="cite">Jose',
<br>
I have compiled latest mapserver from CVS and built java mapscript
<br>
with swig 1.3.29.
<br>
I changed one of the examples as follows:
<br>
<br>
Index: examples/DrawMap.java
<br>
===================================================================
<br>
RCS file:
/data2/cvsroot/mapserver/mapscript/java/examples/DrawMap.java,v
<br>
retrieving revision 1.5
<br>
diff -U3 -r1.5 DrawMap.java
<br>
--- examples/DrawMap.java 24 May 2006 08:26:49 -0000 1.5
<br>
+++ examples/DrawMap.java 3 Oct 2006 06:45:40 -0000
<br>
@@ -27,6 +27,9 @@
<br>
}
<br>
<br>
mapObj map = new mapObj(args[0]);
<br>
+ String path=map.getMappath();
<br>
+ map.setMappath(path);
<br>
+ System.out.println("MAPPATH IS="+path);
<br>
//map.getImagecolor().setRGB(153, 153, 204);
<br>
//styleObj st = map.getLayer(1).getClass(0).getStyle(0);
<br>
//st.getColor().setHex("#000000");
<br>
<br>
and then ran 'make test', which gave no problems.
<br>
I suspect you might have an older version of mapscript (either the .so
<br>
or the .jar) file lying around. In particular check common/lib of your
<br>
tomcat install.
<br>
<br>
Best regards,
<br>
Umberto
<br>
<br>
On 9/29/06, José Vilson de Mello de Farias
<a class="moz-txt-link-rfc2396E" href="mailto:vilson.farias@digitro.com.br"><vilson.farias@digitro.com.br></a> wrote:
<br>
<blockquote type="cite"><br>
Greetings,
<br>
<br>
I've compiled a Mapserver from the latest CVS code (Sept 29) and I'm
<br>
having some problems with Java Mapscript.
<br>
<br>
My system had been running fine until this afternoon, when I
compiled a
<br>
new Mapserver from CVS code. I had to compile a new Swig version before
I
<br>
could start.
<br>
<br>
The Mapserver compilation was fine, and I didn't get any erros. My
goal
<br>
was the Java Mapscript, wich was sucessfully compiled and tested with
"make
<br>
test". After I had deployed and restarted the Tomcat it figured out
that one
<br>
of my example codes wasn't working anymore. The code is very simple,
please
<br>
take a look :
<br>
<br>
<br>
protected void doPost(HttpServletRequest req, HttpServletResponse
resp)
<br>
throws ServletException, IOException {
<br>
log.trace("doGet - request:" + req);
<br>
try {
<br>
PrintWriter p = resp.getWriter();
<br>
<br>
mapObj mapa = new
<br>
mapObj("/home2/java/tomcat/webapps/mapserver_wms/mapas/rio_grande_do_sul.map");
<br>
<br>
mapa.setMappath("/home2/java/tomcat/webapps/mapserver_wms/mapas/shapes_rio_grande_do_sul");
<br>
<br>
imageObj image = mapa.draw();
<br>
<br>
File arqMapa = File.createTempFile("mapa", ".png", new
<br>
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>
}
<br>
catch (Exception e) {
<br>
log.error(e.getLocalizedMessage(), e);
<br>
}
<br>
}
<br>
<br>
After I executed the code above on Firefox, the following error was
showed
<br>
:
<br>
<br>
javax.servlet.ServletException: set_mapObj_mappath
<br>
<br>
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:293)
<br>
<br>
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
<br>
<br>
root cause
<br>
<br>
java.lang.UnsatisfiedLinkError: set_mapObj_mappath
<br>
<br>
edu.umn.gis.mapscript.mapscriptJNI.set_mapObj_mappath(Native
<br>
Method)
<br>
<br>
edu.umn.gis.mapscript.mapObj.setMappath(mapObj.java:195)
<br>
After some tests I found that the problem had been caused by
<br>
mapa.setMappath code. It seems Swig wasn't able to create a proper
<br>
mapscript.jar/libmapscript.so. I checked the mapscript_wrap.c and the
<br>
corresponding method to mapa.setMappath was called
<br>
Java_edu_umn_gis_mapscript_mapscriptJNI_mapObj_1mappath_1set.
<br>
Although I have definitely no experience with Swig, those numbers "1"
in
<br>
method name doesn't look ok. Is it ok? Could be the Swig the
responsible for
<br>
this error?
<br>
<br>
If I remove the mapa.setMappath, everything works fine and my map is
shown
<br>
in the browser.
<br>
<br>
I included some info about my Mapserver and system. By the way, I've
<br>
compiled every component of Mapserver instead of using Linux defaults.
<br>
<br>
<br>
compiled packages (we haven't used any RPMs, all packages were
manually
<br>
compiled/installed)
<br>
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
<br>
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>
Mapserver's configure
<br>
./configure --prefix=/home2/mapserver --without-pdf --with-threads
<br>
--with-zlib=/home2/mapserver/zlib
<br>
--with-png=/home2/mapserver/libpng
<br>
--with-tiff=/home2/mapserver/libtiff
<br>
--with-jpeg=/home2/mapserver/libjpeg
<br>
--with-freetype=/home2/mapserver/freetype
<br>
--with-proj=/home2/mapserver/proj4
<br>
--with-geos=/home2/mapserver/geos/bin/geos-config
<br>
--with-gd=/home2/mapserver/gd
<br>
--with-ogr=/home2/mapserver/gdal/bin/gdal-config
<br>
--with-gdal=/home2/mapserver/gdal/bin/gdal-config
<br>
--with-curl-config=/home2/mapserver/libcurl/bin/curl-config
<br>
--with-wfs --with-wcs --with-wmsclient --with-wfsclient
<br>
--with-php=/usr/include/php
<br>
<br>
Linux
<br>
Linux dgtad 2.6.9-22.EL #1 Mon Sep 19 18:20:28 EDT 2005 i686 athlon
i386
<br>
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:$MAPSCRIPT_HOME">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:$MAPSCRIPT_HOME</a>
<br>
MAPSCRIPT_HOME=$MAPSERVER_HOME/mapscript
<br>
PATH=/usr/java/jre/bin:/usr/java/jdk/bin:$MAPSCRIPT_HOME
<br>
<br>
Java
<br>
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>
Tomcat
<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>
gcc
<br>
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>
Swig
<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>
I'd appreciate any help and thanks in advance.
<br>
<br>
Best regards,
<br>
<br>
<br>
--
<br>
José Vilson de Mello de Farias
<br>
Analista de Sistemas
<br>
SSE - Segurança Pública
<br>
<br>
DÍGITRO TECNOLOGIA
<br>
E-mail: <a class="moz-txt-link-abbreviated" href="mailto:vilson.farias@digitro.com.br">vilson.farias@digitro.com.br</a>
<br>
Messenger: <a class="moz-txt-link-abbreviated" href="mailto:vilsonfarias@hotmail.com">vilsonfarias@hotmail.com</a>
<br>
Fone: (0xx48) 3281-7314
<br>
Fax: (0xx48) 3281-7000
<br>
Site: <a class="moz-txt-link-abbreviated" href="http://www.digitro.com.br">www.digitro.com.br</a>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
<br>
<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>