Evolution 1.11.0.0
SQL Server

OmniExpediente

Estoy creando un nuevo expediente, y al dar clic al icono de la tuerca que muestra el listado de Unidades Administrativas, se genera el mensaje "Error durante la serialización o deserialización mediante JavaScriptSerializer de JSON. La longitud de la cadena supera el valor establecido en la propiedad maxJsonLength."

¿A qué podría deberse este error?

A continuación, les comparto el error registrado en el elmah:

System.Web.HttpException (0x80004005): Error al ejecutar la solicitud secundaria para el controlador System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper. ---> System.Web.HttpUnhandledException (0x80004005): Se produjo una excepción de tipo 'System.Web.HttpUnhandledException'. ---> System.InvalidOperationException: Error durante la serialización o deserialización mediante JavaScriptSerializer de JSON. La longitud de la cadena supera el valor establecido en la propiedad maxJsonLength.
   en System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
   en System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
   en System.Web.Helpers.Json.Encode(Object value)
   en ASP.areas_estructura_views_unidad_indexomex_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
   en System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   en System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   en System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   en System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
   en System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   en System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   en System.Web.UI.Page.HandleError(Exception e)
   en System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   en System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   en System.Web.UI.Page.ProcessRequest()
   en System.Web.UI.Page.ProcessRequest(HttpContext context)
   en System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
   en System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
   en System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
   en System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
   en System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
   en System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
   en System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)
   en System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext)
   en System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext)
   en StackExchange.Profiling.Mvc.WrappedView.Render(ViewContext viewContext, TextWriter writer) en d:\Files\GitHub\miniprofiler\dotnet\StackExchange.Profiling.Mvc\WrappedView.cs:línea 56
   en System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   en System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   en System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
        

asked 18 Oct '17, 15:59

Henry%20Sandoval's gravatar image

Henry Sandoval
(suspended)
accept rate: 53%

edited 18 Oct '17, 16:00


Se verificó que el comportamiento descrito se debía a que se habían creado mas de 73 mil unidades administrativas. Por lo que se procedió a depurar los datos, y ya con esto se validó que ha sido resuelto el incidente reportado.

link

answered 01 Nov '17, 10:50

Henry%20Sandoval's gravatar image

Henry Sandoval
(suspended)
accept rate: 53%

Podrías verificar que esta configuración en el web.config sea suficiente.

<add key="JsonResultMaxByteSize" value="2147483647" />
link

answered 18 Oct '17, 16:27

Fernando%20Paz's gravatar image

Fernando Paz ♦♦
17.3k81635
accept rate: 51%

edited 18 Oct '17, 16:27

Acabo de revisar que el web.config ya tenía esa configuración con el valor indicado, aun antes del inconveniente. Adicionalmente, comentar que esta instalación ya lleva 73,475 registros en la tabla de unidades administrativas.

(18 Oct '17, 17:16) Henry Sandoval Henry%20Sandoval's gravatar image

Si nos basamos en el hecho de que las unidades representan las diferentes gerencias o departamentos en que está organizada una empresa, creo que los usuarios no han entendido este concepto y más bien lo han confundido con plazas, porque mas de 75,000 registros parece excesivo (y probablemente seguirá creciendo)

(18 Oct '17, 17:43) sbarahona ♦♦ sbarahona's gravatar image

Te puse el key del web.config para que supieras cuál es, y así pudieras aumentar a un mayor valor. Aunque aumentar el máximo de 2Gb que tiene por defecto, me parece totalmente insano.

(19 Oct '17, 12:12) Fernando Paz ♦♦ Fernando%20Paz's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Evolution en BitBucket

En este sitio puede acceder al código fuente, centro de descargas y reportar bugs, propuestas y mejoras para Evolution.

Evolution en JIRA

En este sitio puedes sugerir nueva funcionalidad para Evolution, o puedes votar por la funcionalidad ya propuesta por otros usuarios.

Tags:

×8
×8
×4

Asked: 18 Oct '17, 15:59

Seen: 1,358 times

Last updated: 01 Nov '17, 10:50

[Acerca de] [Preguntas Frecuentes] [Privacidad] [Soporte] [Contacto]
Copyright 2013-2018. Asesores en Informática