Random startup bug ...

Trevor Wekel trevor.wekel at autodesk.com
Thu Aug 24 12:53:12 EDT 2006


Hi Francois,

The MapGuide Server will automatically remove sessions that have been inactive for 20 minutes.  The Web Extensions scripts may be trying to use an expired session.  Each  Service created by an MgSiteConnection inherits the MgUserInformation specified in MgSiteConnection.Open.  For your example, MgMap.Open will use the value of $mgSessionId when it pulls information from the session repository.  This session no longer exists so the resources have been removed which leads to the exception you are seeing.

The session timeout is a configurable property of the Site Service.  This parameter can be changed by using the Site Administrator.

Thanks,

Trevor    

-----Original Message-----
From: François Van Der Biest [mailto:francois.van-der-biest at onf.fr] 
Sent: Thursday, August 24, 2006 10:08 AM
To: users at mapguide.osgeo.org
Subject: Random startup bug ...

Hi,

I'm facing an annoying bug in my application (based on the ajaxviewersample code).
At startup, Mapguide is being asked to display some features highlighted. To do so, I made a script that gets executed  when the taskframe loads.

First, I initialize everything ...
%--------------------------------------------------------
    MgInitializeWebTier("$extensionsDir\webconfig.ini");
 
    $userInfo = new MgUserInformation($mgSessionId);
    $siteConnection = new MgSiteConnection();
    $siteConnection->Open($userInfo);
 
    $resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
    $featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
 
    $map = new MgMap();
%--------------------------------------------------------

Then, when opening the resource service with this command : 
$map->Open($resourceService, $mapName);      /// ... where 
$mapName="carte1";
... I sometimes get this message :

La ressource est introuvable: 
Session:8cdada4e-ffff-ffff-8000-0011433afdcd_en//carte1.MapLa
La ressource est introuvable: 
Session:8cdada4e-ffff-ffff-8000-0011433afdcd_en//carte1.Map
Une exception s'est produite dans la méthode MgResourceDefinitionManager.GetDocument à la ligne 476 dans le fichier c:\build_tux_area\mgdev\server\src\services\resource\ResourceDefinitionManager.cpp
(translated : "can't find the resource : Session:8cdada4....."  )

In fact, this seems to occur only when a new session needs to be created (i.e. after a time long enough for the previous one to die).

Does anyone have an idea of what's going wrong here ? Do I miss something ?

Thanks for any help,

F. Van Der Biest






More information about the Mapguide-users mailing list