Opened 14 years ago

Closed 13 years ago

#1436 closed defect (fixed)

Ajax View: Cannot preview the basic web layout

Reported by: hubu Owned by: hubu
Priority: high Milestone: 2.3
Component: General Version: 2.2.0
Severity: blocker Keywords: haspatch
Cc: brucedechant External ID: 1345494

Description (last modified by brucedechant)

When open a basic Web layout, we will encounter a error: Configuration exception: C:\Program Files\Autodesk\!MapGuideEnterprise2011\WebServerExtensions\www\mapviewernet\../webconfig.ini

Comments: This is due to the ACE upgrade to 5.8.0

Attachments (3)

#1436.patch (305 bytes ) - added by hubu 14 years ago.
Fix for this ticket
1436.patch (17.1 KB ) - added by brucedechant 14 years ago.
#1436_Linux.patch (4.5 KB ) - added by hubu 14 years ago.
This is the fix on Linux platform

Download all attachments as: .zip

Change History (11)

by hubu, 14 years ago

Attachment: #1436.patch added

Fix for this ticket

comment:1 by hubu, 14 years ago

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.

comment:2 by brucedechant, 14 years ago

Description: modified (diff)

comment:3 by brucedechant, 14 years ago

Buddy did some additional investigation and this is what he found:

I think I finally got why the configuration file is reload.

We uses MgInitializeWebTier() to initialize the WebTier, and this function is implemented in the WebSupport.vcproj. The WebSupport is a Class Library (not a dynamical libarary). And it’s referenced by many other projects, such as ApacheAgent, CgiAgent, IsapiAgent and WebApi. In this project, we uses a global static variable “m_bInitialized” to indicate whether the webTier is initialized, if it’s true, then will not initialize again (just return). The problem is it’s a Class library, so all the dlls which reference it have the separate “m_bInitialized” with the different address.

Back to the issue. When we open a web layout, the Common.aspx need to initialize the webTier, and the WebApi will invoke the “MgInitializeWebTier()” function. After finish initialized, the value of “m_bInitialized” true, with the address “0x00000001800217b0”. Then the IsapiAgent will invoke “MgInitializeWebTier()” function too, because the mapAgent need to get map from server. At this time, the value of “m_bInitialized” is still false, with the different address “0x0000000002cd1618”. Then the web is initialized one more time and the configuration file is loaded one more time too. And the reloading triggers the error in ACE.

The solution for us is making the WebSupport as a dynamical dll, so that we will have only one “m_bInitialized” totally.

by brucedechant, 14 years ago

Attachment: 1436.patch added

comment:4 by brucedechant, 14 years ago

Resolution: fixed
Status: newclosed

comment:5 by brucedechant, 14 years ago

Cc: brucedechant added

by hubu, 14 years ago

Attachment: #1436_Linux.patch added

This is the fix on Linux platform

comment:6 by hubu, 14 years ago

Resolution: fixed
Status: closedreopened

MapGuide has the same issue on Linux platform, the fix is same with Windows. I have already attached the patch for Linux.

comment:7 by zspitzer, 13 years ago

Keywords: haspatch added

comment:8 by jng, 13 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.