2011-03-24 28 views
0

我們在win2k8服務器上安裝了windows appfabric緩存服務器,並在win2k3 web服務器上從this link安裝了「Windows Server 2003分佈式緩存客戶端」。Windows AppFabric Server(win2k8)與win2k3上的分佈式緩存客戶端不兼容

從緩存工廠獲取緩存對象時,我們正在獲取下面的異常。任何人都可以幫助我們理解異常的原因及其解決方案嗎?請注意,在添加或獲取緩存數據時,不會引發下面的異常。

我們的主要目的是讓win32k3 webserver客戶端將緩存數據放到windows appfabric服務器(win2k8)。

例外: -

System.Runtime.Serialization.SerializationException: There was an error deserializing the object . Input string was not in a correct format. ---> System.FormatException: Input string was not in a correct format. 
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) 
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) 
at System.String.System.IConvertible.ToInt32(IFormatProvider provider) 
at System.Convert.ToInt32(Object value, IFormatProvider provider) 
at System.Runtime.Serialization.FormatterConverter.ToInt32(Object value) 
at System.Runtime.Serialization.SerializationInfo.GetInt32(String name) 
at Microsoft.ApplicationServer.Caching.EvictionConfig..ctor(SerializationInfo info, StreamingContext context) 
at ReadEvictionConfigFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[]) 
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) 
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadSerializationInfo(XmlReaderDelegator xmlReader, Type type) 
at ReadPolicyConfigFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[]) 
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) 
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadSerializationInfo(XmlReaderDelegator xmlReader, Type type) 
at ReadNamedCacheConfigurationFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[]) 
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) 
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns) 
at System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) 
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName) 
--- End of inner exception stack trace --- 
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName) 
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader) 
at Microsoft.ApplicationServer.Caching.Utility.Deserialize(Byte[][] buffers, Boolean checkTypeToLoad) 
at Microsoft.ApplicationServer.Caching.RoutingClient.GetCacheProperties() 
at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) 
+0

,你能不能給我們任何東西多了去上那短短的堆棧跟蹤?一些源代碼也許? – PhilPursglove 2011-03-24 08:51:16

回答

0

這裏是代碼片段: -

DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration(); 
List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>(1); 
servers.Add(new DataCacheServerEndpoint("localhost", 22233)); 
configuration.Servers = servers; 
DataCacheSecurity security = new DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None); 
configuration.SecurityProperties = security; 
DataCacheFactory factory = new DataCacheFactory(configuration); 
DataCache cache = factory.GetCache("default"); // above exception is thrown here