Tuesday, 10 May 2016

Sitecore WFFM Error on 8.1 update 2

On Sitecore 8.1 CD server after using the supplied SwitchMasterToWeb.config and having installed Web Forms For Marketers 8.1 rev 160304 - I get the following error when trying to access a form:

Unable to cast object of type 'System.String' to type 'Sitecore.Analytics.Reporting.ReportDataProvider'

The error occurs because Sitecore is trying to connect to the master Db and is getting a failure because it is not accessible. I suspect that SQL is returning a string error message instead of the expected object.

If you open up the SwitchMasterToWeb.config and comment out the following block it will resolve the issue:

<reporting>
  <dataprovider>
 <datasources>
   <add key="collection">
  <filtersfactory>
    <param desc="definitionDatabaseName" />web
  </filtersfactory>
   </add>
   <add key="reporting">
  <filtersfactory>
    <param desc="definitionDatabaseName" />web
  </filtersfactory>
   </add>
 </datasources>
  </dataprovider>
</reporting>

2 comments:

  1. In our project we have commented out this reporting section on a cd server, but still we are getting the exception as

    Exception: System.InvalidCastException
    Message: Unable to cast object of type 'System.String' to type 'Sitecore.Analytics.Reporting.ReportDataProviderBase'.
    Source: Sitecore.Forms.Core
    at Sitecore.Forms.Core.Dependencies.DefaultImplFactoryObjectsProvider.CreateObject[T](String configPath, Boolean assert)
    at Sitecore.WFFM.Analytics.Dependencies.ReportDataProviderWrapper.GetReportDataProviderBase(Boolean assert)
    at Sitecore.WFFM.Analytics.Providers.AnalyticsFormsDataProvider..ctor(ReportDataProviderWrapper reportDataProviderWrapper, ILogger logger, IAnalyticsTracker analyticsTracker, ISettings settings)

    ReplyDelete
    Replies
    1. Hi Jeyanth, what version of Sitecore are you using?

      Delete