[mapguide-users] Error in Mapguide. An unclassified exception occurred.

Rubén Casal Prieto terri2213 at msn.com
Thu Jan 21 12:45:21 EST 2010


Alguien sabe a que se debe este error?

An unclassified exception occurred.
An unclassified exception occurred. Exception occurred in method MgWebLayout.ParseWebLayoutDefinition at line 293 in file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\web\src\webapp\WebLayout.cpp 

Me lo devuelve mapguide. En la aplicación en la que se produce el error, hago una modificación de un weblayout. Este es el código:

<%@ Page language="c#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections.Specialized" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="OSGeo.MapGuide" %>


<script runat="server">
    //String webLayout = "Library%3a%2f%2fPDPT%2fApp_pdpt.WebLayout";
    String webLayout = "Library://PDPT/App_pdpt.WebLayout";
    String sessionId = "";
</script>

<%
       try
       {
        String realPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];
        String configPath = realPath + "..\\webconfig.ini";
        MapGuideApi.MgInitializeWebTier(configPath);
        
        MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
        MgSite site = new MgSite();
        NameValueCollection requestParams = Page.Request.HttpMethod == "GET" ? Page.Request.QueryString : Request.Form;
       
        site.Open(userInfo);
        sessionId = site.CreateSession();
        HttpContext.Current.Session.Add("sessionId", sessionId);
       
        if (requestParams.Count > 0)
        {
            String strX = requestParams["X"];
            String strY = requestParams["Y"];

            MgSiteConnection siteconection = new MgSiteConnection();
            siteconection.Open(new MgUserInformation(sessionId));
            MgResourceService resourceService = (MgResourceService)siteconection.CreateService(MgServiceType.ResourceService) as MgResourceService;

            MgResourceIdentifier wlresourceId = new MgResourceIdentifier(webLayout);
            MgByteReader wlreader = resourceService.GetResourceContent(wlresourceId);
            String wlXML = wlreader.ToString();
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(wlXML);

             XmlNode NodeCenterx = doc.GetElementsByTagName("CenterX").Item(0);
             NodeCenterx.LastChild.Value = strX;
             XmlNode NodeCenterY = doc.GetElementsByTagName("CenterY").Item(0);
             NodeCenterY.LastChild.Value = strY;
             XmlNode NodeScale = doc.GetElementsByTagName("Scale").Item(0);
             NodeScale.LastChild.Value = "2000";

            MemoryStream streamSave = new MemoryStream();
            doc.Save(streamSave);
            byte[] byteArr = streamSave.ToArray();
            MgByteSource Bytesource = new MgByteSource(byteArr, byteArr.Length);

            //Creamos un weblayout en la sesion para actualizar la nueva versión
            String sessionmapName = wlresourceId.GetName();
            String sessionWebLayout = "Session:" + sessionId + "//PDPT/" + sessionmapName + ".WebLayout";
            MgResourceIdentifier sessionResourceId = new MgResourceIdentifier(sessionWebLayout);
           
            // Escribimos a la session
            resourceService.SetResource(sessionResourceId, Bytesource.GetReader(), Bytesource);
            webLayout = sessionWebLayout;   
       }
        else
        {
            HttpContext.Current.Session.Add("inicio_coordenadas", false);
        }
    }
    catch (Exception e)
    {
        Response.Write(e.Message);
    }
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Xeoportal PDPT</title>

</head>

<frameset rows="40,*" frameborder="no" framespacing="0">
    <frame id="titleFrame" frameborder="no" marginwidth="0" marginheight="0" scrolling="no" src="cabeceira.html">
    <frame id="viewerFrame" frameborder="no" marginwidth="0" marginheight="0" scrolling="no" src="../mapviewernet/ajaxviewer.aspx?SESSION=<%=sessionId%>&WEBLAYOUT=<%=webLayout%>">
</frameset>
<body>
</body>
</html>

Os agradezco la ayuda!! Gracias!! 		 	   		  
_________________________________________________________________
Los auténticos Hotmail y Messenger ahora en tu móvil. ¡Gratis!
http://serviciosmoviles.es.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100121/9475bfb0/attachment.html


More information about the mapguide-users mailing list