-->
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.  [ 8 posts ] 
Author Message
 Post subject: No Persisters for: Arraylist
PostPosted: Fri Jul 08, 2005 5:26 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
I got this strange error today, and I can't seem to pinpoint it.

I know it's probably something simple, but anyway.

When saving an object, I get this error:

No Persisters for: System.Collections.ArrayList


All of my mapping files are marked as Embedded Resources, and all of my collections are of type IList, so I can't figure out what's wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 10, 2005 10:31 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Did you map one of your collection with a class of the typeof(ArrayList)?

(You can post the content of your log.txt after enabling the DEBUG mode)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 6:31 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
can you be a little more specific?

I have lots of collections, but they are all of type IList...

for all of my private members I do the following:

Code:
private IList myCollection = new ArrayList();
public IList MyCollection
{
   //get & set
}


and I haven't had a problem until now... I assume the above is correct usage?

Are there any other common causes of this error that jump out at you?

As for logging, it IS enabled, but I don't seem to get a new log file everyday for some reason.... I only have a handful of logfiles from various days.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 6:56 pm 
Newbie

Joined: Sun Jul 10, 2005 6:30 pm
Posts: 10
i think all you need is this and it should work fine:

Code:
private IList myCollection;
public IList MyCollection
{
   //get & set
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 7:15 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
but then all of the instances where I am creating a new object in the client code will have to instantiate the list, and this is undesirable.

Say I am adding photos to one of my classes....

I shouldn't have to do this:

Code:
myObj.Photos = new ArrayList();
foreach(Photo p in PhotoList)
    myObj.Photos.Add( p );



I think it's better to declare it in the class, so the client code doesn't have to check.. This simplifies LOTS of code.

Also I have been doing this from the get-go and I haven't had problems yet....

ArrayList implements IList, so I don't see why NHibernate would complain. Maybe I'm wrong :/[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 8:04 pm 
Newbie

Joined: Sun Jul 10, 2005 6:30 pm
Posts: 10
I completely agree with you. I dont think an array or IList should every be null but rather always instanced with zero elements.

If this worked for you before than maybe thats not the problem.


Top
 Profile  
 
 Post subject: Re: No Persisters for: Arraylist
PostPosted: Tue Jul 12, 2005 12:07 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Can you post this full exception:
subdigital wrote:
No Persisters for: System.Collections.ArrayList


And your mapping files ?

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 13, 2005 5:44 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
it turned out that the mapping files were fine... one of my developers was using the objects incorrectly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.