我们有一个带有2个节点的复制缓存,我们有时会收到此错误,并且无法解决:“无法将类型为'System.Int32'的对象转换为类型为'System.Collections.ArrayList '。”
堆栈跟踪:
at Alachisoft.NCache.Web.Command.CommandResponse.ParseResponse()
at Alachisoft.NCache.Web.Caching.RemoteCache.Add(String key, Object value, CacheDependency dependency, CacheSyncDependency syncDependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Int16 removeCallback, Int16 updateCallback, Int16 dsItemAddedCallback, Boolean isResyncExpiredItems, String group, String subGroup, Hashtable queryInfo, BitSet flagMap, String providerName, String resyncProviderName, EventDataFilter updateCallbackFilter, EventDataFilter removeCallabackFilter, Int64 size, String clientId)
at Alachisoft.NCache.Web.Caching.Cache.AddOperation(String key, Object value, CacheDependency dependency, CacheSyncDependency syncDependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, DSWriteOption dsWriteOption, CacheItemRemovedCallback onRemoveCallback, CacheItemUpdatedCallback onUpdateCallback, DataSourceItemsAddedCallback onDataSourceItemAdded, Boolean isResyncExpiredItems, String group, String subGroup, Tag[] tags, String providerName, String resyncProviderName, NamedTagsDictionary namedTags, CacheDataNotificationCallback cacheItemUdpatedCallback, CacheDataNotificationCallback cacheItemRemovedCallaback, EventDataFilter itemUpdateDataFilter, EventDataFilter itemRemovedDataFilter, Int64& size, Boolean allowQueryTags, String clientId, Int16 updateCallbackID, Int16 removeCallbackID, Int16 dsItemAddedCallbackID)
at Alachisoft.NCache.Web.Caching.Cache.Add(String key, CacheItem item, DSWriteOption dsWriteOption, DataSourceItemsAddedCallback onDataSourceItemAdded)
at Alachisoft.NCache.Web.Caching.Cache.Add(String key, CacheItem item)
在日志文件中,我们看到:
...received response for request 118849, sender=<IP_Server_1>:7800, val=System.Byte[]
...received response for request 118849, sender=<IP_Server_2>:7800, val=Alachisoft.NCache.Common.DataStructures.Clustered.ClusteredArrayList
我们如何解决此问题?
答案 0 :(得分:0)
您得到的强制转换异常很奇怪。通常会在可能使用无效类型转换的Cache get调用上抛出该错误。但是,在这种特殊情况下,它是在将项目添加到缓存中,这使我相信这是在服务器端。需要对此进行审查-您可以分享一些更多详细信息吗?
请共享完整的应用程序代码片段以及_cache上的流程。在代码中添加API。还要共享NCache版本和版本信息,以便对其进行详细检查。您可以运行“ verifylicense.exe”工具(位于“ C:\ Program Files \ NCache \ bin \ tools \ verifylicense.exe”)来检查当前的NCache版本。
我认为您应该与NCache支持人员联系-support@alachisoft.com-他们的支持非常出色-他们应该能够为您加快速度。