Getting exception with Open method of MgMap Object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting exception with Open method of MgMap Object

Nick Aizen

Having some trouble with the MapGuide API, we installed MapGuide Enterprise 2008 ,we are using asp.net and c # with the MapGuide API. I’m trying to have my page when it initially loads, use a map feature service to filter and select parcels. All seems to work except when I try to open a map object, I get the following exception:

 

OSGeo.MapGuide.MgResourceNotFoundException was unhandled by user code

  Message="Resource was not found: Session:eb1f513e-ffff-ffff-8000-001c23a550ea_en_C0A800020AFC0AFB0AFA//Sheboygan.Map"

  Source="MapGuideDotNetApi"

  StackTrace:

    - MgResourceServiceHandler.ProcessOperation line 80 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceServiceHandler.cpp

    - MgOpGetResourceData.Execute line 132 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\OpGetResourceData.cpp

    - MgServerResourceService.GetResourceData line 1416 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ServerResourceService.cpp

    - MgApplicationRepositoryManager.GetResourceData line 1194 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ApplicationRepositoryManager.cpp

    - MgResourceContentManager.GetDocument line 590 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceContentManager.cpp

    - MgResourceDefinitionManager.GetDocument line 476 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceDefinitionManager.cpp

 

Here’s my code below:

 

    String webLayout = "Library://DevTV/HelloWorld.WebLayout";

    MapGuideApi.MgInitializeWebTier(@"C:\Program Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\webconfig.ini");

    MgUserInformation userInfo = new MgUserInformation("Administrator", "admin");

    MgSite site = new MgSite();

    site.Open(userInfo);

    String sessionId = site.CreateSession();

 

    //Associate a session ID with the MgSiteConnection Object

    MgUserInformation userInfo_new = new MgUserInformation(sessionId);

    MgSiteConnection siteConnection = new MgSiteConnection();

    siteConnection.Open(userInfo_new);

    MgResourceService resourceSrvc =(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService );

    MgMap map = new MgMap();

    map.Open(resourceSrvc, mapName);

 

 

Do I need to perform certain steps in a certain order to get this to work? I would appreciate any help with this issue.

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 


_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting exception with Open method of MgMap Object

Kenneth Skovhede, GEOGRAF A/S
You must create and save the runtime map (MgMap.Create/MgMap.Save) before you can open it.
The viewer does this for you, and it will overwrite an existing runtime map.
If you belive the map is already created, you must obtain the session id from the viewer.
You cannot create a session and read the map from another session.

You probably want to remove the first 6 lines of code, and pass in the sessionId by querystring.
Regards, Kenneth, GEOGRAF A/S


Nick Aizen skrev:

Having some trouble with the MapGuide API, we installed MapGuide Enterprise 2008 ,we are using asp.net and c # with the MapGuide API. I’m trying to have my page when it initially loads, use a map feature service to filter and select parcels. All seems to work except when I try to open a map object, I get the following exception:

 

OSGeo.MapGuide.MgResourceNotFoundException was unhandled by user code

  Message="Resource was not found: Session:eb1f513e-ffff-ffff-8000-001c23a550ea_en_C0A800020AFC0AFB0AFA//Sheboygan.Map"

  Source="MapGuideDotNetApi"

  StackTrace:

    - MgResourceServiceHandler.ProcessOperation line 80 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceServiceHandler.cpp

    - MgOpGetResourceData.Execute line 132 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\OpGetResourceData.cpp

    - MgServerResourceService.GetResourceData line 1416 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ServerResourceService.cpp

    - MgApplicationRepositoryManager.GetResourceData line 1194 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ApplicationRepositoryManager.cpp

    - MgResourceContentManager.GetDocument line 590 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceContentManager.cpp

    - MgResourceDefinitionManager.GetDocument line 476 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceDefinitionManager.cpp

 

Here’s my code below:

 

    String webLayout = "Library://DevTV/HelloWorld.WebLayout";

    MapGuideApi.MgInitializeWebTier(@"C:\Program Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\webconfig.ini");

    MgUserInformation userInfo = new MgUserInformation("Administrator", "admin");

    MgSite site = new MgSite();

    site.Open(userInfo);

    String sessionId = site.CreateSession();

 

    //Associate a session ID with the MgSiteConnection Object

    MgUserInformation userInfo_new = new MgUserInformation(sessionId);

    MgSiteConnection siteConnection = new MgSiteConnection();

    siteConnection.Open(userInfo_new);

    MgResourceService resourceSrvc =(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService );

    MgMap map = new MgMap();

    map.Open(resourceSrvc, mapName);

 

 

Do I need to perform certain steps in a certain order to get this to work? I would appreciate any help with this issue.

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 


_______________________________________________ mapguide-users mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting exception with Open method of MgMap Object

Sandeep Thosar
Dear Kenneth,
 
As per your instructins i read the Developer Guide and also copy my dotnetviewersample to C:/ProgramFiles/MapguideOpenSource2.0/WebServerExtensions/www and my dotnet version is 2.0 still i did not get any output. 
Can you Explain me the Step no 8 and 9 from the InstallMapGuideOpenSourceSample.pdf because i think i did something wrong there only so i did not get any output and also when i run the URL ---> http://localhost/mapguide/dotnetviewersample/ajaxtiledviewersample.aspx

i get error Page can't found.
 
Please help me.
 
With Regards,
 
Sandeep


On Thu, Apr 10, 2008 at 8:44 PM, Kenneth, GEOGRAF A/S <[hidden email]> wrote:
You must create and save the runtime map (MgMap.Create/MgMap.Save) before you can open it.
The viewer does this for you, and it will overwrite an existing runtime map.
If you belive the map is already created, you must obtain the session id from the viewer.
You cannot create a session and read the map from another session.

You probably want to remove the first 6 lines of code, and pass in the sessionId by querystring.
Regards, Kenneth, GEOGRAF A/S


Nick Aizen skrev:

Having some trouble with the MapGuide API, we installed MapGuide Enterprise 2008 ,we are using asp.net and c # with the MapGuide API. I'm trying to have my page when it initially loads, use a map feature service to filter and select parcels. All seems to work except when I try to open a map object, I get the following exception:

 

OSGeo.MapGuide.MgResourceNotFoundException was unhandled by user code

  Message="Resource was not found: Session:eb1f513e-ffff-ffff-8000-001c23a550ea_en_C0A800020AFC0AFB0AFA//Sheboygan.Map"

  Source="MapGuideDotNetApi"

  StackTrace:

    - MgResourceServiceHandler.ProcessOperation line 80 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceServiceHandler.cpp

    - MgOpGetResourceData.Execute line 132 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\OpGetResourceData.cpp

    - MgServerResourceService.GetResourceData line 1416 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ServerResourceService.cpp

    - MgApplicationRepositoryManager.GetResourceData line 1194 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ApplicationRepositoryManager.cpp

    - MgResourceContentManager.GetDocument line 590 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceContentManager.cpp

    - MgResourceDefinitionManager.GetDocument line 476 file c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceDefinitionManager.cpp

 

Here's my code below:

 

    String webLayout = "Library://DevTV/HelloWorld.WebLayout";

    MapGuideApi.MgInitializeWebTier(@"C:\Program Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\webconfig.ini");

    MgUserInformation userInfo = new MgUserInformation("Administrator", "admin");

    MgSite site = new MgSite();

    site.Open(userInfo);

    String sessionId = site.CreateSession();

 

    //Associate a session ID with the MgSiteConnection Object

    MgUserInformation userInfo_new = new MgUserInformation(sessionId);

    MgSiteConnection siteConnection = new MgSiteConnection();

    siteConnection.Open(userInfo_new);

    MgResourceService resourceSrvc =(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService );

    MgMap map = new MgMap();

    map.Open(resourceSrvc, mapName);

 

 

Do I need to perform certain steps in a certain order to get this to work? I would appreciate any help with this issue.

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 

 

 

 

 

 

 

Nick Aizen

GCR & Associates, Inc.

2021 Lakeshore Dr., Suite 500

New Orleans, LA 70122

www.gcr1.com

(504) 304-2500 ext. 2320

Fax: (504) 304-2525

 

cid:338554203@20092007-3664

 


_______________________________________________ mapguide-users mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/mapguide-users

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users



_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users