[mapguide-internals] repository sync issue?

Andreas Morf a.morf at fkl.ch
Mon Apr 19 08:36:50 EDT 2010


Hi all,
For my map application I reimplemented LoadMap.php of Fusion-Viewer in Java
for setting a filter on every layer during map load. This results in a
strange behaviour of mgserver/webtier: Sometimes (after a few minutes or
even hours) the following error showed up
----
javax.servlet.ServletException: A length exception occurred.
string too long
- MgLayerBase.GetLayerInfoFromDefinition() line 695 file
d:\development\mgdev_21\common\platformbase\MapLayer/LayerBase.cpp

org.osgeo.mapguide.MgLengthException: A length exception occurred.
string too long
	at
org.osgeo.mapguide.MapGuideJavaApiJNI.MgLayerBase_SetLayerDefinition(Native
Method)
	at
org.osgeo.mapguide.MgLayerBase.SetLayerDefinition(MgLayerBase.java:104)
	at ch.fkl.mg.fusion.LoadMapServlet.doGet(LoadMapServlet.java:316)
...
----
Concerning code is:

resourceService.SetResource(newLayerResId, layerDefContent, null);
layer.SetLayerDefinition(newLayerResId, resourceService);  // <--- line 316

where newLayerResId is a location in the session repository and
beforementioned commands are executed for every layer of a map.

The strange thing is that if inserting a "sleep(20);" between these
commands, everything seems ok - but this is not an elegant solution.
I can access the saved layer in the session repository with mapagent:
correct LayerDef-XML!
Also with the java webapi sometimes I get the following mgserver
errorlog-entry:
----
Error: An exception occurred in DB XML component.
        Please try your operation later as the repository was busy.
----

Any ideas about these issues or is java simply too fast for mgserver api?

Andreas



More information about the mapguide-internals mailing list