Mapguide 3.1.2 Hangs

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Mapguide 3.1.2 Hangs

Liglio
Hi,

My app is running on a windows server 2019, mapguide 3.1.2, Fusion Viewer
and postgresql 11.5. It keeps refreshing the map on a time basis (last
Period time 1 hour, interval 5 minutes) every 10 seconds filters some
layers. After running several hours (more than 30 hours) it hangs and I got
pink screen. I switched on every mapguide log, but I can't find the reason
in these logs or in the event viewer.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Liglio
Hi,

Now I know where thr error occurs. After several hours filtering layers, I
got the error "Failed to retrieve message for "MgConfigurationException"."
at siteConnection.Open(userInfo);

The next code is at UtilMap class creation. This class is used to manipulate
map layers, like filter, etc.

public UtilMap(string pstrSessionMap, string pstrMapDefinition)
        {
            try
            {
                if (pstrSessionMap.Trim() == "")
                    throw new Exception("Erro UtilMap: parĂ¢metro SessionMap
vazio.");

                strSessionMap = pstrSessionMap;
                strMapDefinition = pstrMapDefinition;
                siteConnection = new MgSiteConnection();
                userInfo = new MgUserInformation(strSessionMap);

                try
                {
                    siteConnection.Open(userInfo);
                }
                catch (Exception ex)
                {
                    throw new Exception("Error UtilMap SiteConnection Open:
" + ex.Message);
                }
                featureService =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
                resourceService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);

                 mapName = strMapDefinition;

                //if mapName is empty, I just want to work with library
repository, no map operations
                if (mapName != "")
                {
                    map = new MgMap(siteConnection);
                    try
                    {
                        map.Open(resourceService, mapName);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Error UtilMap Map Open: " +
ex.Message);
                    }
                }
       }
            catch (Exception ex)
            {
                throw new Exception("Error UtilMap creation: " +
ex.Message);
            }
        }



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Benoit Begin
Might be worth looking into making sure you actually call Dispose on the
MgService you create. Also depending on what else you're doing, I'm guessing
you might have some MgByteReader and the likes that might not get closed and
disposed.

Mapguide also isn't "hung" when the pink map shows up, typically Something
goes wrong with the application pool in IIS and it stops properly
communicating with the Mapguide service. Typically a restart of the app pool
brings everything back fine. Which leads me to think the issue might be with
proper memory management.

As far as I am aware/remember, Mapguide's API in .NET isn't really pure .NET
and is actually a SWIG wrapper over the C++ COM API. So some of the classes
are VERY SENSITIVE about getting properly disposed and closed in your code.
Your code could be making your application pool run out of assignable object
references from the C++ API.

So all in all, try not to declare any "Mg" classes you don't intend to use
and make sure that when you do, you dispose them. The most important ones
are any of the Mg*Reader classes, for reading features, resources, etc.
Likewise for MgService classes.

Regards,

Ben



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Liglio
Hi,

Thanks to your response.
I put in dispose all the Mg elements, after using them, and I still got the
error at the siteconnection open. I have this code running at a MapServer
Infrastructure 2017 without a problem (and not disposing Mg classes).

Any thoughts ?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Benoit Begin
Did you update your binaries for Mapguide when deploying against 3.1.2? AIMS
2017's dlls are for Mapguide 3.1.1.4601, which isn't the same version.
Sometimes I've seen some issues when using the wrong version of the Mapguide
API dlls.

So make sure the content of your BIN folder has the dlls from 3.1.2.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Liglio
This post was updated on .
Hi,

Thanks to your replay.

The binaries are updated, I copied the dlls from the mapguide 3.1.2
installation. The error is related to the mapguide configuration file. I
inspected the original file webconfig.ini enconding and it is US-ASCII not
UTF-8, so I changed it to UTF-8. I am performing a teste right now. I will
wait to see how it goes.

PS: I also changed the encodig to UTF-8 of the following files:

- Server\Resources\mapguide_en.res
 - Web\www\mapagent\Resources\mapguide_en.res
 - Web\www\fusion\text\en
 - Web\www\fusion\text\en.json
 - Web\www\localized\en

--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapguide 3.1.2 Hangs

Liglio
In reply to this post by Benoit Begin
Hi,

You were right the dlls were not the same, it was a 3.0 version. I thought
that I had made the update.

Thanks.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users