Serialization

Posts   
 
    
yider
User
Posts: 6
Joined: 13-Mar-2006
# Posted on: 29-Mar-2006 10:09:33   

Hello,

I have a problem when I serialize my entity. I use the method writeXml (myEntity.writeXml). This methode give me a file xml but I can't deserialize this file. When I use the method (myFile.readXml), I obtain an xmlException. In fact, the structure of this xml file is bad. When I open this file with an wml editor, I detect of the errors.

I find several return to the line which causes a incoherence at the time of the interpretation.

Thank you for your Help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 29-Mar-2006 10:40:18   

Could you please be more specific? -> what's the build of the runtime libraries you're using (both serialization and deserialzation). Right click the ormsupportclasses dll, select properties -> version tab. (in explorer)

The error is about the time specification is wrong?

Frans Bouma | Lead developer LLBLGen Pro
yider
User
Posts: 6
Joined: 13-Mar-2006
# Posted on: 29-Mar-2006 11:10:11   

Version DLL : 1.0.20051.51112

If you want, I can send you my xml file. (By Email for example???)

In fact when I serialize my entity with a method WriteXml, I obtain a file xml containing errors (return to the line in full medium of tag xml) Thus I remove all these return to the line, in order to have an interpretable file xml.

But when I deserialize my file with the method readXml, i obtain a new exception :


contains errors ==>
SystemNullReferenceException : {"Object reference not set to an instance of an object."}


StackTrace : 
"   at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase2.Xml2EntityCollection(XmlNode node, Hashtable processedObjectIDs, ArrayList nodeEntityReferences)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.Xml2Entity(XmlNode node, Hashtable processedObjectIDs, ArrayList nodeEntityReferences)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ReadXml(XmlNode node)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ReadXml(String xmlData)
   at Acta.Cactus.Client.UserInterface.SerializedlFilesForm.DetermineListOfIncident(String[] Localisation) in D:\Projet\Acta\(c)ACTus - DEV\Acta.Cactus.Client.UserInterface\SerializedlFilesForm.vb:line 69
   at Acta.Cactus.Client.UserInterface.SerializedlFilesForm.SerializedFilesForm_Load(Object sender, EventArgs e) in D:\Projet\Acta\(c)ACTus - DEV\Acta.Cactus.Client.UserInterface\SerializedlFilesForm.vb:line 104
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Control.set_Visible(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at Acta.Cactus.Client.UserInterface.MainForm.LoadLocalFiles() in D:\Projet\Acta\(c)ACTus - DEV\Acta.Cactus.Client.UserInterface\MainForm.vb:line 1266
   at Acta.Cactus.Client.UserInterface.MainForm.btnOpenLocalFiles_Click(Object sender, EventArgs e) in D:\Projet\Acta\(c)ACTus - DEV\Acta.Cactus.Client.UserInterface\MainForm.vb:line 897
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at Acta.Cactus.Client.UserInterface.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
   at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
   at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()"

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 29-Mar-2006 12:55:03   

Could you try to use the latest runtime libraries (available in the customer area -> runtime libraries section). Your version is rather old, we've had a couple of bugfixes in the Xml code. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
yider
User
Posts: 6
Joined: 13-Mar-2006
# Posted on: 29-Mar-2006 13:37:06   

Ok I will test with the last version

Thanks