New Posts New Posts RSS Feed: Serialization exception on derived LoginException
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Serialization exception on derived LoginException

 Post Reply Post Reply
Author
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Topic: Serialization exception on derived LoginException
    Posted: 15-Apr-2013 at 10:13am
Hi,


I created my own LoginException but I every time I throw it get this error on the client (Silverlight 5) :
"The Login could not be completed because the server did not respond. Check that the server is available and contains a clientApplicationType configuration setting which supports this application."

Then I took the sample code from here http://drc.ideablade.com/devforce-2012/bin/view/Documentation/authentication-details-custom to check my code and I still get the same error. (The class is defined on both the server and client)

On the log it seems there is a problem with the Serialization.

Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans Security.Domain.Services.tn.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans IdeaBlade.EntityModel.Server.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans System.ServiceModel.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans System.ServiceModel.dll
Une exception de première chance de type 'System.Runtime.Serialization.SerializationException' s'est produite dans System.Runtime.Serialization.dll

My web.config configuration looks like this :

<ideablade.configuration xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig" version="6.00" clientApplicationType="Silverlight">
    <logging logFile="log\DebugLog.xml" port="9922" serviceName="TracePublisher" archiveLogs="false" />
    <objectServer>
      <serverSettings useAspNetSecurityServices="false" />
      <serverSettings allowAnonymousLogin="false" />
      <serverSettings supportedClientApplicationType="Silverlight"/>
    </objectServer>
    <!-- See the DevForce Resource Center for more information on configuration settings:
http://drc.ideablade.com/devforce-2012/bin/view/Documentation/deploy-iis#HConfiguration
    -->
  </ideablade.configuration>
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Apr-2013 at 5:14pm
Unfortunately, this is due to a bug. It looks like our reflection provider is not correctly handling the properties on LoginException sub-classes and causing a serialization problem. Afraid I can't think of a workaround.

We'll get this fixed in the next release, date TBD.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 30-Apr-2013 at 5:56pm
kdev, this was fixed in the 7.1.2 release now available.
Back to Top
kdev View Drop Down
Groupie
Groupie
Avatar

Joined: 03-Jan-2013
Posts: 83
Post Options Post Options   Quote kdev Quote  Post ReplyReply Direct Link To This Post Posted: 01-May-2013 at 12:25am
thanks kimj

I will try as soon as Cocktail will update it's dependencies to Devforce
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 22-Aug-2013 at 1:20pm
Does this problem only exist for LoginException or does it block all custom exceptions even ones inheriting from System.Exception? I am on 7.1.0.0 and am hitting an error when I add my custom exception as a known type. I believe I followed all of the rules and so I am wondering if I need to upgrade because of the bug or if I am just not doing it right. 

[DataContract]|
//[DiscoverableType(DiscoverableTypeMode.KnownType)]
    public class MyException : Exception
    {
        [DataMember]
        public int Code { getset; }
 
        public MyException(string message, Dictionary<stringobject> userData) : base(message)
        {
            Code = (int) userData["Code"];
            //used for serialization
        }
 
        public MyException(string message, int code) : base(message)
        {
            Code = code;
        }
 
    }
If I uncomment that code the EntityServer will fail to start because it is not able to serialize MyException.
-John Bloom
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 22-Aug-2013 at 2:12pm
I think I figured it out. I needed to inherit from EntityServerException.
-John Bloom
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down