-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: DynamicProxy errors on multiple servers
PostPosted: Thu Jan 03, 2008 12:54 pm 
Newbie

Joined: Thu Jan 03, 2008 10:44 am
Posts: 3
I'm not sure if this is this best place to ask this question...but here goes.

We have created an Ecommerce website using .Net 2.0 with Castle Monorail framework(R2) and NHibernate 1.2.1.GA. Our production environment uses Microsoft SQL Server 2000 - 8.00.2039 and our testing environment uses Microsoft SQL Server 2005 - 9.00.1399.06. We will upgrading our production DB to 2005 soon.

We also have another website created with ASP.Net that uses NHibernate (the error below is from this website) but we have recently incorporated some of the Castle Monorail framework into this project.

We have a cluster set up with 7 servers. We can run the website without errors on one server, but when we try to use more than one server we get the error below.

We upgraded NHibernate because we thought some code changes we saw between the versions would fix this, but we are still having these errors.

Any suggestions would be greatly appreciated.


Code:
Object of type 'System.Int32' cannot be converted to type 'System.String'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.

Source Error:


[No relevant source lines]



Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8e19a758\8492f456\App_Web_hquxbepo.12.cs    Line: 0

Stack Trace:


[ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.String'.]
   System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) +843
   System.Reflection.RtFieldInfo.InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, Boolean doVisibilityCheck, Boolean doCheckConsistency) +136
   System.Runtime.Serialization.FormatterServices.SerializationSetValue(MemberInfo fi, Object target, Object value) +71
   System.Runtime.Serialization.FormatterServices.PopulateObjectMembers(Object obj, MemberInfo[] members, Object[] data) +116
   Castle.DynamicProxy.Serialization.ProxyObjectReference.RecreateClassProxy(SerializationInfo info, StreamingContext context) +768
   Castle.DynamicProxy.Serialization.ProxyObjectReference.RecreateProxy(SerializationInfo info, StreamingContext context) +119
   Castle.DynamicProxy.Serialization.ProxyObjectReference..ctor(SerializationInfo info, StreamingContext context) +454

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context) +0
   System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context) +22
   System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context) +110
   System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) +259
   System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder) +44
   System.Runtime.Serialization.ObjectManager.DoFixups() +167
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +203
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
   System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader reader) +745
   System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert() +54
   System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String name, Boolean check) +257
   System.Web.SessionState.SessionStateItemCollection.DeserializeAllItems() +88
   System.Web.SessionState.SessionStateItemCollection.GetEnumerator() +9
   System.Web.SessionState.HttpSessionStateContainer.GetEnumerator() +10
   System.Web.TraceContext.EndRequest() +3803
   System.Web.UI.Page.ProcessRequestEndTrace() +2008327
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
   System.Web.UI.Page.ProcessRequest() +86
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.order_partyconnectinfo_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8e19a758\8492f456\App_Web_hquxbepo.12.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64



Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 3:33 pm 
Newbie

Joined: Thu Jan 03, 2008 10:44 am
Posts: 3
After looking further into this error, here is what we are thinking...

Castle.DynamicProxy is used for lazy loading purposes and deserializes the proxy which is a subclass of your class. For reasons we cannot figure out, the order of the fields in the serialization stream changes. So it's [string, bool] on serialization, but [bool, string] on deserialization and you end up with this error.

Any ideas on a course of action?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2008 6:04 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
You might want to also cross post this question on the Castle forums at http://www.castleproject.org.

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 07, 2008 11:12 am 
Newbie

Joined: Thu Jan 03, 2008 10:44 am
Posts: 3
I did and all they said was to update Castle to Release 3. My manager is not convinced it has anything to do with Castle.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 07, 2008 12:14 pm 
Beginner
Beginner

Joined: Wed Jun 29, 2005 10:40 am
Posts: 30
Location: denver, co
I've experienced this problem, and the only workaround I've found is to implement ISerializable on your domain objects and handle serialization yourself. This definitely is a problem with Castle.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.