Sitecore WFFM 保存到数据库失败
Posted
技术标签:
【中文标题】Sitecore WFFM 保存到数据库失败【英文标题】:Sitecore WFFM Save To Database failed 【发布时间】:2015-04-01 11:02:28 【问题描述】:我在 Sitecore 日志文件中收到以下错误。在 WFFM 表单中的“保存到数据库”操作中。面向营销人员的 Web 表单 2.4 修订版。 141008.
我有一个自定义 WFMDataProvider,它只返回一个连接字符串。我在生产 CD 而不是 CMS 上收到错误。 (我没有使用 remoteWfmService)我错过了什么?
3292 09:42:32 ERROR Save To Database failed.
Exception: System.Reflection.ReflectionTypeLoadException
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()
at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors)
at System.Data.Metadata.Edm.ObjectItemCollection.LoadTypesExpensiveWay(Assembly assembly)
at System.Data.Objects.DataClasses.RelationshipManager.TryGetRelationshipType(IEntityWrapper wrappedOwner, Type entityClrType, String relationshipName, AssociationType& associationType)
at System.Data.Objects.DataClasses.RelationshipManager.GetRelatedEndInternal(String relationshipName, String targetRoleName)
at System.Data.Objects.DataClasses.RelationshipManager.GetRelatedReference[TTargetEntity](String relationshipName, String targetRoleName)
at Sitecore.Forms.Data.Field..ctor(IField field, Form form)
at Sitecore.Forms.Data.DataProviders.WFMDataProvider.<>c__DisplayClass7.<InsertForm>b__6(IField f)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Sitecore.Forms.Data.DataProviders.WFMDataProvider.InsertForm(IForm form)
at Sitecore.Forms.Data.DataManager.InsertForm(ID formId, AdaptedResultList fields, ID sessionID, String data)
at Sitecore.Form.Submit.SaveToDatabase.Execute(ID formid, AdaptedResultList fields, Object[] data)
3292 09:42:32 WARN Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Exception: System.Reflection.ReflectionTypeLoadException
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()
at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors)
at System.Data.Metadata.Edm.ObjectItemCollection.LoadTypesExpensiveWay(Assembly assembly)
at System.Data.Objects.DataClasses.RelationshipManager.TryGetRelationshipType(IEntityWrapper wrappedOwner, Type entityClrType, String relationshipName, AssociationType& associationType)
at System.Data.Objects.DataClasses.RelationshipManager.GetRelatedEndInternal(String relationshipName, String targetRoleName)
at System.Data.Objects.DataClasses.RelationshipManager.GetRelatedReference[TTargetEntity](String relationshipName, String targetRoleName)
at Sitecore.Forms.Data.Field..ctor(IField field, Form form)
at Sitecore.Forms.Data.DataProviders.WFMDataProvider.<>c__DisplayClass7.<InsertForm>b__6(IField f)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Sitecore.Forms.Data.DataProviders.WFMDataProvider.InsertForm(IForm form)
at Sitecore.Forms.Data.DataManager.InsertForm(ID formId, AdaptedResultList fields, ID sessionID, String data)
at Sitecore.Form.Submit.SaveToDatabase.Execute(ID formid, AdaptedResultList fields, Object[] data)
at Sitecore.Form.Core.Submit.SubmitActionManager.ExecuteSaving(ID formID, ControlResult[] list, ActionDefinition[] actions, Boolean simpleAdapt, ID sessionID)
3292 09:42:32 WARN Web Forms for Marketers: an exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. has occured while trying to execute an action.
【问题讨论】:
您使用的密码是否包含特殊字符?我发现 WFFM 不能很好地处理这些,因为连接字符串被解析为实体框架连接字符串。如果是这样,我会尝试一个简单的密码来排除这种情况。 No 密码没有任何疯狂的特殊字符。 你的连接字符串是什么样子的?你检查过连接字符串中的元数据部分了吗? 您是否已发布所有表单并提交操作?您在remoteWfmService
connectionString 中指定的用户是否对表单项具有必要的权限?还要确保 WFFM 和任何自定义保存操作 dll 已正确部署到 CD。
【参考方案1】:
我发现 MSCaptcha.dll 没有部署。通常,当此文件丢失时,您会收到异常。但在这种情况下,App_Config\include\Captcha.config 也丢失了。
如果您删除这 2 个文件,看起来一切都适用于表单(没有验证码),但保存到数据库操作不起作用,需要这个 MSCaptcha.dll。因此给出了问题中提到的错误。 我几乎可以肯定这是问题所在。我只需要一个部署来确认。
【讨论】:
以上是关于Sitecore WFFM 保存到数据库失败的主要内容,如果未能解决你的问题,请参考以下文章
Sitecore 8.0(构建 3)MVC WFFM 自定义验证器不工作