Taritsyn/MsieJavaScriptEngine

JsEngineLoadException: During loading of MSIE JavaScript engine error has occurred.

ramijack opened this issue · 11 comments

Hi Taritsyn,

I am getting below exception, intermittently on Windows Server 2008R2.
not able to reproduce this exception on my local windows 7.
can you please provide some more info on the reason for this issue.

System.Web.HttpException: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'.
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.b__17()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult)
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.b__3()
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at JavaScriptEngineSwitcher.Core.Utilities.Utils.CreateInstanceByFullTypeName[T](String fullTypeName) at JavaScriptEngineSwitcher.Core.JsEngineSwitcher.CreateJsEngineInstance(String name) at BundleTransformer.Less.Compilers.LessCompiler..ctor(Func1 createJsEngineInstance, CompilationOptions defaultOptions)
at BundleTransformer.Less.Translators.LessTranslator.Translate(IList1 assets) at BundleTransformer.Core.Transformers.TransformerBase.Translate(IList1 assets, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.CssTransformer.Transform(IList1 assets, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, HttpContextBase httpContext, Boolean isDebugMode) at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext context, BundleResponse response, Boolean isDebugMode) at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable1 bundleFiles)
at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
at System.Web.Optimization.AssetManager.EliminateDuplicatesAndResolveUrls(IEnumerable1 refs) at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable1 assets)
at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
at ASP._Page_XXXXXXX_YYYYYY_ZZZZZ__Head_cshtml.Execute() in c:*************_Head.cshtml:line 13
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at AW.Web.Mvc.BaseView`1.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName)
at ASP.xxxxx_yyyyy_zzzzz_aaaaa_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of MSIE JavaScript engine error has occurred.
See more details:

The requested lookup key was was not found in any active activation context.
at JavaScriptEngineSwitcher.Msie.MsieJsEngine..ctor(MsieConfiguration msieConfig)
System.ComponentModel.Win32Exception: The requested lookup key was was not found in any active activation context.
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Threading.Dispatcher..ctor()
at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase..ctor(String clsid, String engineModeName, String lowerIeVersion, Boolean useEcmaScript5Polyfill, Boolean useJson2Library)
at MsieJavaScriptEngine.MsieJsEngine..ctor(JsEngineMode engineMode, Boolean useEcmaScript5Polyfill, Boolean useJson2Library)
at JavaScriptEngineSwitcher.Msie.MsieJsEngine..ctor(MsieConfiguration msieConfig)

Hello, Ramesh!

What version of Internet Explorer installed on the server?

Hi Taritsyn,

IE8 is installed on the server.
Also the "Bundle Transformer" Version 1.8.33 and "Msie JavaScript Engine" version 1.4.3.0 is being used.

Quote from description of the JavaScriptEngineSwitcher.Msie package:

For correct working of the MSIE JavaScript Engine it is recommended to install Internet Explorer 9 and above on a server.

You have 2 variants to solve this problem:

  1. Install Internet Explorer 9 or above on server.
  2. Use a JavaScriptEngineSwitcher.V8 package (requires the Visual C++ Redistributable Packages for Visual Studio) instead of the JavaScriptEngineSwitcher.Msie package.

Is there any specific reason why IE8 misbehaves ?
As it seems its a Win32 Exception in MsieJavaScriptEngine with message "The requested lookup key was was not found in any active activation context."

does this error message points to any specific set of problem ?

  1. What version of MsieJavaScriptEngine you use?
  2. Which mode of MsieJavaScriptEngine you use (Auto, Classic, ChakraActiveScript, ChakraIeJsRt и ChakraEdgeJsRt)?

In any case, BundleTransformer.Less will not work without a Internet Explorer 9 or above (an “Out of stack space” error will occur).

  1. MsieJavaScriptEngine version 1.4.3.0 is being used
  2. Auto mode is being used.

Will this error "Out of stack space" always occur, or it will occur intermittently ?

... "Msie JavaScript Engine" version 1.4.3.0 is being used.

This version is already 2 years. Many bugs have been fixed for 2 years.

Update a libraries to modern versions.

Actually these libraries are being used in older version of my company's product, and one of the customer is facing this issue intermittently.

Anyhow, i will try to get these libraries updated.

i was just curious to figure out the exception, why its happening, in case not able to update the libraries

Will this error "Out of stack space" always occur, or it will occur intermittently ?

This error will occur when executing a large amount of JS code, i.e. most part of the Bundle Transformer modules will cause this error.

I will get IE8 upgraded, and will get that tested.

Thank you Taritsyn

i was just curious to figure out the exception, why its happening...

It's hard for me answer this question, because you are using an old version of library with old version of Internet Explorer. I know only one thing, that you do not complied recommendation specified in description of package.