<span class="gmail_quote"></span><span class="gmail_quote">Sorry, my last message don't see correctly.<br><br></span><div><span class="q" id="q_116576ce6601031c_1">Hello:<br><br>I'm new using Java Mapscript but I can't execute the examples (
DrawMap.java) with my testmap.map.<br><br>This is my system.
<br><br>Linux OpenSuse 10.2<br>mapserv -v results<br>MapServer version 4.8.4 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE
<br><br>Java -v results<br>java version "1.5.0_08"<br>Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)<br>Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)<br><br>the Java IDE is netbeans
5.5.1<br><br>This is my testmap file:<br><br><br><span style="font-style: italic; font-weight: bold;">MAP</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">NAME servidor
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">EXTENT 626680 4191039 817176 4519393</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
SYMBOLSET "etc/symbol.sym"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">FONTSET "etc/fonts.txt"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">IMAGECOLOR 255 153 255</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">IMAGETYPE jpeg</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">RESOLUTION 96</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;">
<br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">WEB</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGEPATH "/var/www/tmp"
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGEURL "/tmp"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
METADATA</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> "wms_title" "servidor wms icv"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> "wms_online_resource" "******************************************"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
"wms_srs" "EPSG:23030 EPSG:25830 EPSG:4230 EPSG:4258"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> </span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> END</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">END</span><br style="font-style: italic; font-weight: bold;">
<br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">REFERENCE</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
EXTENT 626690 4186545 823410 4519390</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGE "./key_map.png"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> SIZE 150 200</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> STATUS ON</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> COLOR -1 -1 -1</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> OUTLINECOLOR 255 0 0</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">PROJECTION
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> "init=epsg:23030"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">OUTPUTFORMAT</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> NAME jpeg</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> DRIVER "GD/JPEG"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> MIMETYPE "image/jpeg"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGEMODE RGB</span>
<br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> EXTENSION "jpg"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
FORMATOPTION "QUALITY=100"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">OUTPUTFORMAT</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> NAME png</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> DRIVER "GD/PNG"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> MIMETYPE "image/png"
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGEMODE RGBA</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
EXTENSION "png"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> TRANSPARENT ON</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
FORMATOPTION "INTERLACE=ON"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">OUTPUTFORMAT</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> NAME gif</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> DRIVER "GD/gif"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> MIMETYPE "image/gif"
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> IMAGEMODE PC256</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
EXTENSION "gif"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> TRANSPARENT ON</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
FORMATOPTION "INTERLACE=ON"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;">LAYER</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> NAME "rios_principales_1000"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> GROUP "Hidrografía"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> CONNECTION "host=****** port=****** dbname=capas user=******* password=******"
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> CONNECTIONTYPE Postgis</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
DATA "the_geom from rios_principales_1000"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> TYPE LINE</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> METADATA</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> "wms_name" "rios_principales_1000"
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> "wms_group_title" "Hidrografía"</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> END</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> CLASS</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> NAME "riosPpal1000"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> TITLE ""
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> SIZE 4</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
COLOR 0 112 255</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> LABEL</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
ANGLE AUTO</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> MINDISTANCE 1500</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
COLOR 190 232 255</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> OUTLINECOLOR 0 112 255</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> SIZE 8</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> TYPE truetype</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> FONT "fritqat-italic"</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> POSITION auto
</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> END</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
END</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> STATUS ON</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">
END</span><br style="font-style: italic; font-weight: bold;"><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;">END<br><br></span>The same testmap.map works fine with php_mapscript.
<br><br>When execute the DrawMap.java example crash in the line (43)<br><br><span style="font-weight: bold; font-style: italic;"> imageObj img = map.draw();<br><br></span>This is the error:<br><br><span style="font-style: italic; font-weight: bold;">
Exception in thread "main" java.lang.UnknownError: Unable to initialize image.</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> at edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw
(Native Method)</span><br style="font-style: italic; font-weight: bold;"><span style="font-style: italic; font-weight: bold;"> at edu.umn.gis.mapscript.mapObj.draw(mapObj.java:382)</span><br style="font-style: italic; font-weight: bold;">
<span style="font-style: italic; font-weight: bold;"> at es.gva.icv.jmapscript.DrawMap.main(DrawMap.java:43)<br><br></span>I have searched about this error in internet, but I have found nothing.<br><br>Thanks in advance.
<br><span>Luis Conti<br>
</span>
</span></div>