[mapserver-users] java mapscript + postgis = jvm crashed
Ludovico Bianchini
metlud at yahoo.it
Tue Sep 23 13:50:05 PDT 2008
Umberto Nicoletti ha scritto:
> I am using postgis layers (on Linux, though) and it works fine.
>
> Do you share the same mapObj between threads (in application scope) or
> multiple requests (in session scope)?
> mapscript is safe only when a new mapObj is created for each request.
> What other kind of layers do you have in your map?
>
> Umberto
>
>
> On Mon, Sep 22, 2008 at 10:34 PM, Ludovico Bianchini <metlud at yahoo.it> wrote:
>
>> - Windows Vista Home Premium
>> - Postgres 8.1
>> - jvm 1.6.0
>> - jboss 4.0.3SP1, tomcat 5.5
>> - struts2
>> - ms4w 2.2.3 (mapscript.jar, mapscript.dll, all other dlls taken from this pack)
>> - postgresql-8.2-505.jdbc4.jar
>>
>> mapscript.jar is placed in C:\jboss-4.0.3SP1\server\default\deploy\jbossweb-tomcat55.sar
>>
>> When a layer with a postgis connection is turned on, the draw method crashes the jvm.
>>
>> Error file attached.
>>
>> Is there any solution to this problem?
>>
>> Postgis is listed in "unsafe components", i have not understood if there is one way to make it work using thread syncronization.
>>
>> Thanks in advance for any help.
>>
>> Ludovico
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi
>> http://mail.yahoo.it
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>>
>
>
>
I think I do not share the same object between request.
The other layer are shape file layer, they work fine (zoom ok, pan ok).
<struts><!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
.
.
.
<action name="Mappa*" class="segnaletica.action.MappaAction"
method="{1}">
<result>/jsp/mappa.jsp</result>
.
.
.
</action>
</package>
</struts>
public class MappaAction extends ActionSupport implements
ServletRequestAware{
.
.//attributes
.
.
public String execute() throws Exception {
mapObj mapObj_o = new
mapObj("C:\\jboss-4.0.3sp1_map\\map\\treviso.map");//create a new mapObj
object
if(OP == null) OP = "-1";
int op = Integer.parseInt(OP);
switch (op) {
case Z_IN: zoomIn(mapObj_o);
break;
case Z_OUT: zoomOut(mapObj_o);
break;
case PAN: pan(mapObj_o);
break;
case REFRESH: refresh(mapObj_o);
break;
default: fullExtent(mapObj_o);
break;
}
return SUCCESS;
}
.
.//utility methods, map navigation methods
.
private void draw(mapObj mapObj_o){
.
.
mapImageObj = mapObj_o.draw();//this instruction crashes the JVM
.
.
}
}
########################################################
#### LAYER SEGNALETICA
####
########################################################
LAYER
NAME "segnaletica"
STATUS OFF
TYPE POINT
TRANSFORM false
POSTLABELCACHE true
CONNECTION "user=user password=password dbname=dbname
host=localhost port=5432"
CONNECTIONTYPE postgis
DATA "posizionegeoref from rilievi.impianti"
CLASS
STYLE
COLOR 255 99 0
SYMBOL "circle"
SIZE 12
END
END
PROJECTION
"init=epsg:4326"
END
END
Ludovico
Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
More information about the MapServer-users
mailing list