2

I am using javascript to load data from list. But every now and then i get error

Unexpected response from server

Sometimes i get and sometimes i dont. I googled and someone suggested to free memory and end noderunner.exe in task manager. I did it and it worked once. But now its not working. Here is code to get list

context = new SP.ClientContext.get_current();

    web = context.get_web();
    list = web.get_lists().getByTitle(listName);
    camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml("<View>" +
        "<ViewFields>" +
        "<FieldRef Name='Id'/>" +
        "<FieldRef Name='Name'/>" +

        "</ViewFields>" +
        "<RowLimit>" + pageSize + "</RowLimit></View>");
    //camlQuery.set_viewXml("<View><RowLimit>" + pageSize + "</RowLimit></View>");

    spItems = list.getItems(camlQuery);
    context.load(spItems, 'Include(Name,Id)'); //Retrieves the properties of a client object from the server.

    context.executeQueryAsync(
        Function.createDelegate(this, success),
        Function.createDelegate(this, fail));
}

What to do to get rid of this error?

Update1 I checked application log and i get this

WebHost failed to process a request.
     Sender Information:      System.ServiceModel.ServiceHostingEnvironment+HostingManager/27642486
 Exception: System.ServiceModel.ServiceActivationException: The service    '/_vti_bin/client.svc' cannot be activated due to an exception during             compilation.  The exception message is: Operation is not valid due to the current state of the object.. ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
  at Microsoft.SharePoint.ApplicationRuntime.SPLayoutsMappedFile.MapLayoutsVirtualPath(String virtualPath)
   at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
  at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
  at System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath)
  at   System.ServiceModel.ServiceHostingEnvironment.HostingManager.GetCompiledCustomString(String normalizedVirtualPath)
  at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
 at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
  at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
  --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)

Process Name: w3wp Process ID: 11140

  • 1
    I suggest you to use Fiddler to find out what is exactly that unexpected response sent by the server. – pholpar May 21 '15 at 20:54
  • Do you have multiple WFEs? If yes, perhaps one of them is having issues and you only see it when you end up to that server. – Jussi Palo May 22 '15 at 7:06
  • How to check if there are multiple WFE? If there are multiple WFE then how to solve it – Happy May 22 '15 at 8:46
  • Its my development env so no multiple WFE. – Happy May 22 '15 at 15:15
  • Try freeing up resource by running 'Set-SPEnterpriseSearchService -PerformanceLevel Reduced' in PowerShell. Are you using administrator account? Do you have explicit permissions on the list? – Arsalan Shahid May 22 '15 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.