locked
500 - Internal Server Error when run some WebTests (for example "CreateNewAccount") (CRM 2011). RRS feed

  • Question

  • Help me please, or write if You have the same problem.

    I have "500 internal server error" when running some standart webtests, from PerfToolKit Build . For Example "CreateNewAccount"

    CreateNewAccount

    <?xml version="1.0" encoding="utf-8" ?> 
    - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <soap:Body>
    - <soap:Fault>
      <faultcode>soap:Server</faultcode> 
      <faultstring>System.Web.Services.Protocols.SoapException: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.Application.WebServices.AppGridWebService.Refresh(String gridXml) ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.Application.WebServices.AppGridWebService.Refresh(String gridXml) --- End of inner exception stack trace --- at Microsoft.Crm.Application.WebServices.AppGridWebService.Refresh(String gridXml)</faultstring> 
      <faultactor>http://win-24fgtb4miko:5555/Base/appwebservices/appgridwebservice.asmx</faultactor> 
    - <error xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <exception>Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #64223EA7Detail: <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> <ErrorCode>-2147220970</ErrorCode> <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> <Message>System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #64223EA7</Message> <Timestamp>2012-07-11T10:47:25.6083984Z</Timestamp> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </OrganizationServiceFault></exception> 
      <parameters xsi:nil="true" /> 
      <displaytitle /> 
      <displaytextencoded /> 
      <displaytext /> 
      <description>Object reference not set to an instance of an object.</description> 
      <file>Not available</file> 
      <line>Not available</line> 
      <details>Not available</details> 
      <traceInfo /> 
      <requesturl>http://win-24fgtb4miko:5555/Base/appwebservices/appgridwebservice.asmx</requesturl> 
      <pathAndQuery>/Base/appwebservices/appgridwebservice.asmx</pathAndQuery> 
      <source>SOAP</source> 
      <stacktrace>[NullReferenceException: Object reference not set to an instance of an object.] at Microsoft.Crm.Application.WebServices.AppGridWebService.Refresh(String gridXml)</stacktrace> 
      </error>
      </soap:Fault>
      </soap:Body>
      </soap:Envelope>


    • Edited by FSI_80 Wednesday, July 11, 2012 3:07 PM
    Wednesday, July 11, 2012 11:02 AM

All replies

  • I just ran into this issue and wanted to provide a resolution for anyone else experiencing the issue. The problem happens because the gridxml now requires an otn (object type name) to be passed when the grid is refreshed after one of the update rollups, I think UR4. This causes the original test cases to fail once it tries to execute the request to refresh the grid. There are a few ways to get past this issue.

    1. Record a new test case from scratch.
    2. You could comment out the one request that is trying to refresh the grid, Since the OOB test cases will perform all other steps successfully. That way everything will be completed except the grid refresh.
    3. Update the code in the utils.js to include the otn variable.

    To fix the issue the code change will be within the Utils.cs file which contains methods for the various grids. For example you were trying to run CreateNewAccount. The following steps will describe how to fix this test case.

    1. Open the code for CreateNewAccount.

    2. Within the CreateNewAccount code there is a line of code that is generating the gridXml as shown below.
    gridXml = GridXmlHelper.AccountPageViewRefresh(-1, myAccountsView, null);

    3. Right click on AccountPageViewRefresh and choose go to Definition. This will take you to the code in the Utils.js file that needs to be updated.

    4.Once you get to the AccountPageViewRefresh method in the utils.js there will be a variable called grid. This variable will be set to a line of xml with a variety of settings. Add the following code after the </otc> tag.
    <otn>account</otn>

    5. refresh the test case in the test list editor and run it again. Now the gridxml should contain the otn tag which will allow the test to succeed. This code should work for UR4-UR6.
    In UR7-UR11 they again made enhancements to the appgridwebservice which will require new test cases to be recorded.

    Hope this helps

    Tuesday, October 16, 2012 1:46 PM
  • Excellent post. As we're facing exact this issue and have UR11, could you provide us an information how to update the utils.js file in this case?

    We already struggled over the .dlls that we needed to exchange and we removed the references from the OfflineSync Test as the CRM_Perf_Tool solution won't compile using the new CRM dll's from UR 11.

    Is there more we need to keep in mind?

     - it passed for CreateNewAccount changing the utils.cs as suggested !!!

    - still fails for other test i.e CreateNewLead 

    Thursday, December 13, 2012 12:30 PM