无法映射到属性'说明'在类型' ...'

时间:2015-12-16 18:30:06

标签: sitecore glass-mapper

我想我现在可能会遇到GlassMapper的一个主要错误。加载页面时,有时在尝试映射模型时会崩溃。

我可以重现这个错误,我对原因有很好的了解。例如,当我修改一个特定版本(语言)但将其保留在草稿(工作流程)中时,它将发生。当我发布项目时,似乎glassmapper使用的缓存只包含共享数据。

我目前正在使用GlassMapper 3.5,并且我对更新到版本4并不是很舒服,因为它知道它意味着重要的变化。

任何人都知道如何解决这个问题?

由于

Exception: Glass.Mapper.MapperException
Message: Failed to map to property 'Description' on type 'CPA.Data.SitecoreEntity.Pages.ContentPage'
Source: Glass.Mapper
   at Glass.Mapper.AbstractDataMapper.MapCmsToProperty(AbstractDataMappingContext mappingContext)
   at Glass.Mapper.Configuration.AbstractTypeConfiguration.<>c__DisplayClassb.<CreatePropertyExpression>b__a(Object obj, AbstractDataMappingContext context)

Nested Exception

Exception: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: System.Core
   at System.Collections.Generic.HashSet`1.SetCapacity(Int32 newSize, Boolean forceNewHashCodes)
   at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value)
   at Sitecore.Caching.ItemPathsCache.<>c__DisplayClass10.<AddToKeyIndex>b__e(String key, HashSet`1 oldValue)
   at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, TValue addValue, Func`3 updateValueFactory)
   at Sitecore.Caching.ItemPathsCache.AddToKeyIndex(ItemPathCacheKey partialCacheKey, String longId)
   at Sitecore.Caching.ItemPathsCache.AddMapping(Item item, ItemPathType itemPathType, String path)
   at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type, Item root, Int32 level)
   at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type)
   at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String from, String separator, ItemPathType type)
   at Sitecore.Data.ItemPath.GetPath(Item currentItem, String from, String separator, ItemPathType type)
   at Sitecore.Data.ItemPath.get_LongID()
   at Sitecore.Caching.AccessResultCache.AddRecord(ISecurable entity, Account account, AccessRight accessRight, PropagationType propagationType, AccessResult accessResult)
   at Sitecore.Security.AccessControl.ItemAuthorizationHelper.GetAncestorAccess(Item item, Account account, AccessRight accessRight, PropagationType propagationType)
   at Sitecore.Security.AccessControl.ItemAuthorizationHelper.GetItemAccess(Item item, Account account, AccessRight accessRight, PropagationType propagationType)
   at Sitecore.Buckets.Security.AuthenticationHelper.GetItemAccess(Item item, Account account, AccessRight accessRight, PropagationType propagationType)
   at Sitecore.Security.AccessControl.ItemAuthorizationHelper.GetAccess(Item item, Account account, AccessRight accessRight)
   at Sitecore.Security.AccessControl.AuthorizationProvider.GetAccess(ISecurable entity, Account account, AccessRight accessRight)
   at Sitecore.Security.AccessControl.AuthorizationManager.IsAllowed(ISecurable entity, AccessRight right, Account account)
   at Sitecore.Data.Managers.ItemProvider.ApplySecurity(Item item, SecurityCheck securityCheck)
   at Sitecore.ContentTesting.Pipelines.ItemProvider.GetItem.GetItemUnderTestProcessor.Process(GetItemArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
   at Sitecore.Data.Managers.ItemManager.GetItem(ID itemId, Language language, Version version, Database database)
   at Sitecore.Links.MediaLinkExpander.Expand(String& text, UrlOptions urlOptions)
   at Sitecore.Links.LinkProvider.LinkParser.ExpandDynamicLinks(String text, UrlOptions options)
   at Sitecore.Links.LinkManager.ExpandDynamicLinks(String text, Boolean resolveSites)
   at Sitecore.Pipelines.RenderField.ExpandLinks.Process(RenderFieldArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Glass.Mapper.Sc.DataMappers.SitecoreFieldStringMapper.GetField(Field field, SitecoreFieldConfiguration config, SitecoreDataMappingContext context)
   at Glass.Mapper.AbstractDataMapper.MapCmsToProperty(AbstractDataMappingContext mappingContext)

0 个答案:

没有答案