-->
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.  [ 1 post ] 
Author Message
 Post subject: XmlSerializer with NHibernate.Collection.Set
PostPosted: Tue Feb 06, 2007 5:52 pm 
Newbie

Joined: Tue Feb 06, 2007 4:55 pm
Posts: 1
I am working on an application where I am trying to perform a data import from an exported XML file into a new system using NHibernate. Currently the application is set up to take the input XML and transform it using XSLT into the serialized version of the objects for the database. In running some general serialization tests to get the schema for transforming the input XSLT, I have encountered some issues. It seems any object I have that has members with associations via NHibernate.Collection.Set won't serialize properly. Here is the error detail:

Exception: There was an error reflecting type 'GeoLearning.Core.Volume'.
Inner Exception: You must implement a default accessor on NHibernate.Collection.Set because it inherits from ICollection.
Stack Trace: at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel)
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a)
at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at GeoLearning.Courseware.Meta.WS.VolumeService.GetVolumes() in c:\Projects\Courseware\Public\CoursewareMeta\App_Code\VolumeService.cs:line 319

The Volume object contains four different sets that link to other objects in the same library. I have tried to serialize this through the SoapFormatter and it seems to work fine, but the translation to write into the format that the SoapFormatter needs looks like it will be a lot more work. Is this a bug with NHibernate or do I need to be doing this a different way?


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

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.