Showing posts with label SQL Server Reporting Service. Show all posts
Showing posts with label SQL Server Reporting Service. Show all posts

Wednesday, 4 February 2015

Report error in Dynamics AX

We had the following error while users were trying to print reports from AX.
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was 'Element 'http://tempuri.org/:queryBuilderArgs' contains data from a type that maps to the name 'http://schemas.datacontract.org/2004/07/XppClasses:SrsReportProviderQueryBuilderArgs'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'SrsReportProviderQueryBuilderArgs' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details.
The problem goes away if you point the SSRS to another AOS through the AX client configuration or by restarting the AOS.

This posting is provided "AS IS" with no warranties. Use code at your own risk.

Friday, 24 January 2014

SSRS service start issue

Last week I configured multiple instances of SQL Server Reporting Service on the same computer for AX2012. I did so following the article on TechNet. One of the step is to Modify Reporting Services configuration files. After completion of this step I tried re-starting the SSRS service and it won't start. Windows event log had following error.
Service cannot be started. System.Exception: Default appdomain failed to initialize.
   at Microsoft.ReportingServices.Library.ServiceAppDomainController.Start()
   at Microsoft.ReportingServices.Library.ReportService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
SSRS's own log which can be found in the folder "C:\Program Files\Microsoft SQL Server\MSRS10_50.<INSTANCE_NAME>\Reporting Services\LogFiles" had the following text in the log file.
rshost!rshost!540!01/20/2014-14:40:35:: i INFO: CLR runtime is initialized.
rshost!rshost!540!01/20/2014-14:40:35:: i INFO: Derived memory configuration based on physical memory as 4193848 KB
appdomainmanager!DefaultDomain!328!01/20/2014-14:40:35:: i INFO: Entered managed ServiceMain in DefaultDomain.
configmanager!DefaultDomain!ad8!01/20/2014-14:40:36:: e ERROR: Error loading configuration file: The configuration file contains an element that is not valid. The #text element is not a configuration file element.
library!DefaultDomain!ad8!01/20/2014-14:40:36:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: , Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error.  ---> System.Exception: The configuration file contains an element that is not valid. The #text element is not a configuration file element.
   at Microsoft.ReportingServices.Diagnostics.ExtensionsConfiguration.ParseExtensionElement(XmlNode child, Extension& extension, String childName)
   at Microsoft.ReportingServices.Diagnostics.ExtensionsConfiguration.ParseDataExtensions(XmlNode child, ExtensionArray array)
   at Microsoft.ReportingServices.Diagnostics.ExtensionsConfiguration.ParseExtensions(XmlNode child, ExtensionArray array)
   at Microsoft.ReportingServices.Diagnostics.ExtensionsConfiguration.ParseXML(XmlNode node)
   at Microsoft.ReportingServices.Diagnostics.RSConfigurationFileManager.ParseDocument(XmlDocument xmlConfiguration)
   at Microsoft.ReportingServices.Diagnostics.RSConfigurationFileManager.LoadDocument()
   at Microsoft.ReportingServices.Diagnostics.RSConfigurationFileManager.LoadConfiguration()
   --- End of inner exception stack trace ---;
appdomainmanager!DefaultDomain!ad8!01/20/2014-14:40:36:: e ERROR: Appdomain:1 DefaultDomain failed to initialize. Error: Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error.  ---> System.Exception: The configuration file contains an element that is not valid. The #text element is not a configuration file element..
appdomainmanager!DefaultDomain!710!01/20/2014-14:40:36:: e ERROR: Windows service failed to start. Exception: System.Exception: Default appdomain failed to initialize.
   at Microsoft.ReportingServices.Library.ServiceAppDomainController.Start()
   at Microsoft.ReportingServices.Library.ReportService.OnStart(String[] args)
servicecontroller!DefaultDomain!540!01/20/2014-14:40:36:: i INFO: RPC Server stopped. 
servicecontroller!DefaultDomain!540!01/20/2014-14:40:36:: i INFO: Service shutting down.
A quick search on internet resulted in different proposals some involving security rights issue other suggesting a reinstall. As the error suggests there is something wrong with the configuration file.

The clue came from SQL Server Support Team blog. It turned out that while making the changes to the configuration file rsreportserver.config I left some extra text. Comparing the corrupted file with a healthy file, using a text editor compare tool, highlighted the changes I made and the extra stuff entered by mistake. I removed the extra stuff and the service started successfully.

This posting is provided "AS IS" with no warranties. Use code at your own risk.