[mapguide-trac] #1436: Ajax View: Cannot preview the basic web layout

MapGuide Open Source trac_mapguide at osgeo.org
Tue Sep 14 05:24:20 EDT 2010


#1436: Ajax View: Cannot preview the basic web layout
-----------------------+----------------------------------------------------
   Reporter:  hubu     |       Owner:  hubu 
       Type:  defect   |      Status:  new  
   Priority:  high     |   Milestone:  2.3  
  Component:  General  |     Version:  2.2.0
   Severity:  blocker  |    Keywords:       
External_id:  1345494  |  
-----------------------+----------------------------------------------------

Comment(by hubu):

 This is caused by ACE 5.8.0 integration.
 in the ACE_Configuration_Heap::open() function, there are some new lines
 to detect whether the allocator_ is null like this

   if (this->allocator_ != 0)
     {
       errno = EBUSY;
       return -1;
 }

 The function ACE_Configuration_Heap::open() is invoked when open the
 webconfig.ini (by m_config.open()). The first time we open the
 webconfig.ini, everything works fine. If the webconfig.ini has been
 already opened, the value of allocator_ is not null. At this time, if we
 try to open it again, we will get ACE EBUSY status and return -1. Then the
 m_config.Open() will fail.

 In MapGuide, the MgConfiguration::LoadConfiguration() function, we have
 following code

     m_fileLoaded = false; ;//solution #1, remove this line
     m_fileName = fileName
     if(m_config.Open())
     {
         if(m_config.ImportConfig(fileName))
         {
             m_fileLoaded = true;
         }
         ……………
     }
     else
     {
         ACE_ERROR((LM_ERROR, ACE_TEXT("%p\n"),
 ACE_TEXT("MgConfiguration::LoadConfiguration()")));
     }


 The varable "m_fileLoaded" is used to indicate whether the webconfig.ini
 is loaded. When the config.Open() failed, the m_fileLoaded is false,
 however the webconfig.ini is loaded actually in the first time. The
 incorrect m_fileLoaded will block the basic web layout to display.

 Solution #1:
 Remove the statement "m_fileLoaded = false;" before config.Open(). Then
 the value of m_fileLoaded is correct.
 But this solution will result in MG can't reload the configure file. I am
 afraid this solution will affect the GeoRest(Seems GeoRest will load a
 configure file other than webconfig.ini). I have attached #1436.patch for
 this solution.

 Solution #2:
 Remove the new lines from the ACE source code. Maybe this solution will
 some affect ACE functions.

 Solution #3:
 Reset the allocator_ to null before call config.open(), by destructing the
 m_config and constructing a new instance. Side effect of this solution
 still unknown.

-- 
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/1436#comment:1>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list