-->
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.  [ 10 posts ] 
Author Message
 Post subject: MappingException: No persister for: java.lang.Boolean
PostPosted: Wed Aug 31, 2005 5:24 pm 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
Dear All,

I am facing a strange problem (net.sf.hibernate.MappingException: No persister for: java.lang.Boolean) while committing my persistent class. I used transaction.commit();

Note: Please see below for exact exception message.

Your quick help is highly appreciated.

Thanks
Raza Naqvi

net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java(Compiled Code))
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2656)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 5:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
show the full stacktrace

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 5:52 pm 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
I've seen a solution in http://www.c2b2.co.uk/iPoint/ipoint?SelectedPage=58. But it was working for me earlier on JDK 1.4 itself.

FYI, I am using IBM WSAD 5.1 as IDE.

Please see the complete stack trace below

Thanks
Raza Naqvi

net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java(Compiled Code))
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2656)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2663)
at net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(SessionImpl.java:2725)
at net.sf.hibernate.type.EntityType.getIdentifier(EntityType.java:66)
at net.sf.hibernate.type.EntityType.isDirty(EntityType.java:164)
at net.sf.hibernate.type.TypeFactory.findDirty(TypeFactory.java(Compiled Code))
at net.sf.hibernate.persister.AbstractEntityPersister.findDirty(AbstractEntityPersister.java(Compiled Code))
at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java(Compiled Code))
at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java(Compiled Code))
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2224)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2203)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at com.hib.CmdBase.update(CmdBase.java:84)
at com.hib.inv.FacCmd1.go(FacCmd1.java:112)
at com.hib.CmdBase.exec(CmdBase.java:46)
at com.hib.inv.InvFac.run(InvFac.java:243)
at com.hib.inv.InvFac.main(InvFac.java:89)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 5:53 pm 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
Sorry to confuse you. The link http://www.c2b2.co.uk/iPoint/ipoint?SelectedPage=58 says that the problem is related with JDK version.

- Raza Naqvi


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 2:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so you have a value that is a Boolean instead of being an actual reference to a persistent class....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 4:50 am 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
No, It is not Boolean. I am able to print the persistent object and it's member variables in the debug logger message before committing it and Hence it is not a Boolean.

- Raza


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 4:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok if you don't belive me then step through the code its opensource.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 4:13 am 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
My code goes something like this

session = PersistenceSessionFactory.getSession();
transaction = session.beginTransaction(); //
Account acc = (Account) session.load(Account.class,ID);// This Account is my actual persistent object.
acc.setXYZ(100);
acc.setABC("test");
id = (Integer) session.save(acc); // This tries to save my acc object to DB.
transaction.commit(); // Here is where I get the exception.
session.close();

I am getting the exception when I do transaction.commit. I am able to print acc.toString() as logger message just before doing transaction.commit.

Please help out.

Thanks
Raza


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 4:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes and you have probably mapped a boolean field to another class/entity in Account.

check your mappings...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 6:55 am 
Newbie

Joined: Mon Aug 29, 2005 1:04 pm
Posts: 9
Location: Hyderabad, INDIA
Probably that could be the problem. Because I've created a new sample persistent class and tried updating the object. It worked for me.

Thank you Max. I will work on the this exception and let you know the updates.

Thanks to hibernate team as well.

- Raza.


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