[mapserver-users] Java MapScript and Tomcat6 Hanging

Gilbertson, Paul paulbe at ceh.ac.uk
Thu Jul 22 10:07:07 EDT 2010


Umberto,

Absolute lock up. Process is running, but never responds to requests. Tomcat creates threads for new requests, and accepts them, they just never return data. Tomcat/JVM never crashes.

The synchronized keyword was an attempt to fix this, symptoms are the same with or without it.

Regards,
Paul Gilbertson


> -----Original Message-----
> From: Umberto Nicoletti [mailto:umberto.nicoletti at gmail.com]
> Sent: 22 July 2010 15:04
> To: Gilbertson, Paul
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Java MapScript and Tomcat6 Hanging
> 
> Hi Paul,
> please define hang: is it a crash or simply a momentary stall?
> 
> In the case it is the latter I see the synchronized keyword in the
> definition of the doLogic method and by looking at the code you have
> posted it seems superflous, but there might be some other code that
> you didn't post that makes it necessary. Anyway I would start looking
> there.
> 
> HTH,
> Umberto
> 
> On Wed, Jul 21, 2010 at 4:41 PM, Gilbertson, Paul <paulbe at ceh.ac.uk>
> wrote:
> > Good folks,
> >
> > I am somewhat new to MapServer and MapScript, and I'm trying to do a
> few experiments with Java Mapscript in order to scope out MapServer's
> feasibility for a large project.
> >
> > I've downloaded and installed MS4W 3.0 beta 11, and Netbeans 6.9 with
> Tomcat 6.0.29 in order to test out Java Mapscript. I created a most
> basic servlet to serve up simple map tiles, and it works for serial
> requests. When I try to serve two requests at the same time Tomcat
> hangs hard.
> >
> > My map file and Java classes are below:
> >
> > MAP
> >  IMAGETYPE      PNG24
> >  NAME           "nbndemo"
> >  STATUS         ON
> >  EXTENT         -12.5 12.5 700000 1300012.5
> >  SIZE           800 800
> >  IMAGECOLOR     226 245 255
> >  CONFIG         "MS_ERRORFILE" "/ms4w/apps/nbndemo/error.txt"
> >  DEBUG          5
> >
> >  PROJECTION
> >    "init=epsg:27700"
> >  END
> >
> >  LAYER
> >    NAME         os250k
> >    STATUS       ON
> >    TILEINDEX    "/OSRasterTiles/os_250k/os250k_tindex_srs.shp"
> >    TILEITEM     "Location"
> >    TYPE         RASTER
> >    OFFSITE      71 74 65
> >
> >    PROJECTION
> >      "init=epsg:27700"
> >    END
> >    EXTENT         -12.5 12.5 700000 1300012.5
> >  END
> > END
> >
> > public class SPRewriter {
> >    public synchronized void doLogic(HttpServletRequest request,
> HttpServletResponse response) throws Exception
> >    {
> >        ServletOutputStream out = response.getOutputStream();
> >        edu.umn.gis.mapscript.mapObj mo = new
> mapObj("/ms4w/apps/nbndemo/mapfiles/test.map");
> >
> >        imageObj image = mo.draw();
> >        response.setContentType(image.getFormat().getMimetype());
> >        out.write(image.getBytes());
> >        image.delete();
> >        mo.delete();
> >    }
> > }
> >
> >    protected void processRequest(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException {
> >        try {
> >            SPRewriter spr = new SPRewriter();
> >            spr.doLogic(request, response);
> >        }  catch (Exception e) {
> >            e.printStackTrace();
> >        }
> >    }
> >
> > Any thoughts why this would hang the moment I try to run parallel
> requests?
> >
> > Regards,
> > Paul Gilbertson
> >
> >
> >
> > --
> > This message (and any attachments) is for the recipient only. NERC
> > is subject to the Freedom of Information Act 2000 and the contents
> > of this email and any reply you make may be disclosed by NERC unless
> > it is exempt from release under the Act. Any material supplied to
> > NERC may be stored in an electronic records management system.
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >

-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.



More information about the mapserver-users mailing list