[mapserver-users] Java mapscript: connection timeout

Ishwari Sivagnanam ishwari.s at gmail.com
Thu Sep 4 09:17:54 EDT 2008


I removed all the layers that use OGR connection but that didn't solve the
problem either.

But we did isolate the problem to two particular layers: There are two
thematic maps that 'cannot' coexist. The timeout occurs only when those two
layers come into the picture. I can display only one of these two thematic
maps. Each of these layers contains about 100 polygons and are joined to
tables which contain about 600 records. I am at a complete loss!!!!

I have pasted the map file specs for those two layers below. I have also
attached my most recent hs_err*.log.

This time I also set DEBUG 5 in my mapfile and interestingly the
"ms_error.txt" has no entries after the timeout occurs. There are no errors
reported there.

I do have some mapserver questions:
1) If I have 5 POSTGIS layer definitions and 7 Mapinfo layers(which I
removed) in a mapfile does that mean that I have 12 connections that are
made or is this considered a single connection?

2) Does Java Mapscript have a limit on the number of records that it can
retrieve per request?

3) What happens between Mapserver, Java Mapscript and JVM? My hs_err*.log
always mentions this.

4) If I have more than one 'map' page do the following situations make a
difference:
  (i) have individual .jsp/.java page pairs for each map page (all the java
pages have the same mapscript code, but different mapfiles)
  (ii) have individual .jsp pages for each map page(so two map pages would
mean 2 jsp pages) but have a single java page which calls different mapfiles
or different functions based on the jsp page the url request comes from.

I have the exact same pages running in PHP with no issue.

Any and all help is appreciated,
Thanks,
Ishwari


-----------------------------------   layer details from Mapfile
-----------------------------------------------------------

#*******************************
#* layer definition area1     *
#*******************************
  LAYER
    CONNECTIONTYPE POSTGIS
    NAME "rspropn"
    CONNECTION "host=localhost user=postgres password=xxxxx dbname=xxxxx
port=5432"
    METADATA
      "DESCRIPTION" "Density by area1"
      "GNAME" "Thematic Maps"
    END
    GROUP Thematic

    DATA 'wkb_geometry FROM (select ROUND(CAST ("Seretailerpropn" as
numeric),2)as seppn ,* from "gsduplarea1" AS a, "GSSummaryRetailer" as b
WHERE a."ExecutiveCode" = b."Executivecode") as test using unique ogc_fid
using unique wkb_geometry using SRID=4326'

    STATUS OFF
    TYPE POLYGON

    HEADER '/ms4w/apps/xxxxxxxx/templates/area12_header.html'
    FOOTER '/ms4w/apps/xxxxxxxx/templates/area12_footer.html'


    CLASSITEM "seppn"

    CLASS # CLASS 1: 0% - 0.5%
    NAME "0% - 0.5%"
    EXPRESSION ([seppn]GE 0 AND [seppn]LE 0.5)
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 160 208 255
      END


     END

     CLASS # CLASS 2: 1.0% - 2.0%
    NAME "0.5% - 2.0%"
    EXPRESSION ([seppn]GT 0.5 AND [seppn]LE 2.0 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 128 160 255
      END


     END

     CLASS # CLASS 3: 2.0% - 5.0%
    NAME "2.0% - 5.0%"
    EXPRESSION ([seppn]GT 2.0 AND [seppn]LE 5.0 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 80 96 255
      END


     END

     CLASS # CLASS 4: 5.0% - 25.0%
    NAME "5.0% - 25.0%"
    EXPRESSION ([seppn]GT 5.0 AND [seppn]LE 25 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 48 48 255
      END


     END

     CLASS # CLASS 5: 25% - 50%
    NAME "25% - 50%"
    EXPRESSION ([seppn]GT 25.0 AND [seppn]LE 50)
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 0 0 255
      END


     END
     CLASS # CLASS 6: value GE 51
    NAME "50% or more"
    EXPRESSION ([seppn] GE 51 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/area12_query.html'

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 0 0 255
      END


     END

    METADATA
    wkb_geometry_type "wkb_geometry |geometry"
    END

   END # end layer area1


#*******************************
#* layer definition sales     *
#*******************************
  LAYER
    CONNECTIONTYPE POSTGIS
    NAME "sales"
    CONNECTION "host=localhost user=postgres password=xxxxxxx
dbname=GISXONTUserxxxxxxxx port=5432"
    METADATA
      "DESCRIPTION" "% of Sales(August '08)"
       "GNAME" "Thematic Maps"
    END
    GROUP Thematic

    DATA 'wkb_geometry FROM (select ROUND(CAST (sepropn as numeric),2)as
test,* from "GSExecutiveArea" AS a, "GSExecutiveMonthlySalesSummary" As b
Where a."ExecutiveCode" = b.executivecode) as sesales using unique ogc_fid
using unique wkb_geometry using SRID=4326'

    STATUS OFF
    TYPE POLYGON
    #PROCESSING "CLOSE_CONNECTION=DEFER"

    FILTER "intperiod =200808"

    HEADER '/ms4w/apps/xxxxxxxx/templates/SEArea_header.html'
    FOOTER '/ms4w/apps/xxxxxxxx/templates/SEArea_footer.html'

    METADATA
    #query_returned_attributes '"ExecutiveCode"'
    wkb_geometry_type "wkb_geometry |geometry"
    END

    DEBUG ON
    CLASSITEM "sepropn"
    #LABELITEM "executivecode"

    CLASS # CLASS 1: No data
    NAME "0% - 0.5%"
    EXPRESSION ([sepropn]GE 0 AND [sepropn]LT 0.5)
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/SEArea_query.html'
      DEBUG ON

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 255 255 208
      END


     END

     CLASS # CLASS 2: 0 - 10%
    NAME "0.5% - 1.0%"
    EXPRESSION ([sepropn]GE 0.5 AND [sepropn]LT 1.0 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/SEArea_query.html'
      DEBUG ON

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 192 240 176
      END


     END

     CLASS # CLASS 3: 10 LT value LE 15
    NAME "1.0% - 2.0%"
    EXPRESSION ([sepropn]GE 1.0 AND [sepropn]LT 2.0 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/SEArea_query.html'
      DEBUG ON

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 128 208 144
      END


     END

     CLASS # CLASS 4: value GE 51
    NAME "2.0% - 5.0%"
    EXPRESSION ([sepropn]GE 2.0 AND [sepropn]LT 5 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/SEArea_query.html'
      DEBUG ON

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 0 160 80
      END
     END

    CLASS # CLASS 6: value GE 5
    NAME "5% or more"
    EXPRESSION ([sepropn] GE 5 )
    TEMPLATE '/ms4w/apps/xxxxxxxx/templates/SEArea_query.html'
      DEBUG ON

    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 10
        COLOR 0 160 80
      END
     END
 END # end layer SEArea

-----------------------------------   layer details from Mapfile
-----------------------------------------------------------






On Mon, Sep 1, 2008 at 5:53 PM, Umberto Nicoletti <
umberto.nicoletti at gmail.com> wrote:

> I would start by removing the ogr layers: move them to postgis or even
> better to shapefiles using the ogr2ogr utility.
> Try to have only shapefiles or postgis layers in your mapfiles and see
> if that helps. Disabling the ogr component is not strictly necessary
> (even thouh it is recommended) provided that you do not use it.
>
> Regards,
> Umberto
>
> On Mon, Sep 1, 2008 at 1:28 PM, Ishwari Sivagnanam <ishwari.s at gmail.com>
> wrote:
> > Given below are the specs for what I have installed on my machine. I
> > downloaded and installed the ms4w package with the windows installer. So
> I
> > haven't done any builds. And I haven't removed any dlls.
> >
> > I added the ntwdblib.dll to the cgi-bin folder. I believe this is used to
> > connect SQL server and PHP. The data was originally in SQL server before
> I
> > moved it all to Postgres.
> >
> > OS: Windows XP
> > gcc version : don't know what this is
> > MapServer: version 5.0.0
> > Java : JDK 1.6 (NetBeans IDE 5.5.1)
> > Java mapscript - the .dll and .jar file that are part of the ms4w package
> > Apache Tomcat 5.5
> >
> > Other:
> > --------
> > PHP MapScript Version - ($Revision: 6872 $ $Date: 2007-09-10 10:45:30
> -0400
> > (Mon, 10 Sep 2007) $)
> > ogr: i use the ogr2ogr library to call MapInfo layers
> >
> > Database:
> > --------------
> > PostgreSQL 8.2.3
> > PostGIS 1.3.2
> >
> > I read through the howto document that you pointed me to. I will check on
> > the connection pooling.
> >
> > Unsafe components: I do use the ogr library since I have mapInfo files. I
> > can move them to postgis. But I don't know how to disable the components.
> > Since I didn't compile Java Mapscript I don't know how to fix this.
> >
> > Please find attached the most recent hs_err*.log from my machine.
> >
> > Thanks for your help
> > :-)
> >
> > Ishwari
> >
> > On Mon, Sep 1, 2008 at 2:51 PM, Umberto Nicoletti
> > <umberto.nicoletti at gmail.com> wrote:
> >>
> >> Ok, now we're getting somewhere, but I need more information.
> >> Read the fine manual (all of it, twice ;-)) at:
> >>
> >> http://mapserver.gis.umn.edu/docs/howto/javamapscript
> >>
> >> and report all the information it mentions in the last section.
> >> In particular I need to know if you compiled java mapscript by
> >> yourself or used the ms4w packages.
> >> Also make sure you attach the hs_err*.log files.
> >>
> >> Regards,
> >> Umberto
> >>
> >> On Mon, Sep 1, 2008 at 11:04 AM, Ishwari Sivagnanam <
> ishwari.s at gmail.com>
> >> wrote:
> >> > The error message is the standard "Connection timeout" or "Unable to
> >> > connect" page that appears in Firefox and the 'page not available' (I
> >> > couldn't attach a screen capture). The platform is windows XP.
> >> >
> >> >  Ocassionally loading the application stops Tomcat completely.
> >> >
> >> > Should I send the error log ?
> >> >
> >> > Thanks,
> >> > Ishwari
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Mon, Sep 1, 2008 at 12:32 PM, Umberto Nicoletti
> >> > <umberto.nicoletti at gmail.com> wrote:
> >> >>
> >> >> Please post the exact error message and architecture you're running
> >> >> (version of Windows, linux, etc)?
> >> >>
> >> >> Umberto
> >> >>
> >> >> On Mon, Sep 1, 2008 at 7:53 AM, Ishwari Sivagnanam
> >> >> <ishwari.s at gmail.com>
> >> >> wrote:
> >> >> > Hello all,
> >> >> > I developed a mapserver site in Java mapscript and have run into a
> >> >> > timeout
> >> >> > issue. I have tried to explain the problem as best as I can below.
> I
> >> >> > am
> >> >> > new
> >> >> > to web application development and mapserver so I apologize for
> >> >> > errors
> >> >> > in
> >> >> > the description.
> >> >> >
> >> >> > I have two seperate mapserver pages in my website. The scripting is
> >> >> > done
> >> >> > using Java Mapscript and JSP pages. The backend data comes from a
> >> >> > Postgresql/ PostGIS database. I developed the exact same
> application
> >> >> > in
> >> >> > PHP
> >> >> > and 'deployed' it. I have had no issues with that site. The Java
> >> >> > mapscript
> >> >> > was developed along the same lines as the PHP application.
> >> >> > Both mapserver pages share ~ 10 base maps. Additionally each of
> these
> >> >> > pages
> >> >> > has a set of thematic maps. Page 1 has 2 thematic maps of the same
> >> >> > point
> >> >> > layer and a third thematic layer with a summary statistic for a
> >> >> > polygon
> >> >> > layer. Page 2 has a single thematic map which displays a summary
> >> >> > statistic
> >> >> > of a polygon layer. Page 1 by itself works well. Page 2 by itself
> >> >> > works
> >> >> > well.
> >> >> > The problem occurs when
> >> >> > (a) page 1 and page 2 are merged or
> >> >> > (b) if they are deployed parallely in the same site
> >> >> > I get an message which says "Connection timed out".
> >> >> > I have tried searching the web for an answer but haven't been very
> >> >> > successful
> >> >> >
> >> >> > Version and Specs:
> >> >> > ----------------------------
> >> >> > MapServer version 5.0.0
> >> >> > PHP MapScript Version - ($Revision: 6872 $ $Date: 2007-09-10
> 10:45:30
> >> >> > -0400
> >> >> > (Mon, 10 Sep 2007) $)
> >> >> > PostgreSQL 8.2.3
> >> >> > PostGIS 1.3.2
> >> >> >
> >> >> > Apache Tomcat 5.5
> >> >> > Java 1.6
> >> >> > Java mapscript - Downloaded and installed using the page in the
> >> >> > mapserver.umn.. website
> >> >> >
> >> >> > Could somebody help me please?
> >> >> >
> >> >> > Ishwari
> >> >> >
> >> >> >
> >> >> > _______________________________________________
> >> >> > mapserver-users mailing list
> >> >> > mapserver-users at lists.osgeo.org
> >> >> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >> >> >
> >> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > mapserver-users mailing list
> >> > mapserver-users at lists.osgeo.org
> >> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >> >
> >> >
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080904/1b5ce81e/attachment-0001.html


More information about the mapserver-users mailing list