-->
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: JRE incompatibility, gives no persister for : java.lang.Long
PostPosted: Thu Oct 30, 2003 5:01 pm 
Newbie

Joined: Thu Oct 30, 2003 4:44 pm
Posts: 5
Hi,

I have Java code with Hibernate mapping files to map to a db2 database, the application runs fine within Websphere 5.0 (i.e using IBM JRE 1.3 ) but when i switch to a Sun JRE 1.3.1_01 the same app does not work, it gives a No Persister for : java.lang.Long or some other such errors, in short it is not able to talk to the database.

I am using Hibernate 2.0.3. I tried rebuilding Hibernate with Sun's JRE and including the hibernate2.jar built, but this makes no difference.

There is a related problem i have noticed : If there are two Setter functions for a complex property, hibernate gets confused between the two methods using Sun's JRE but does not if i use IBM JRE.

example :
class Container
{
getContent( ) returns a Content object,
setContent( Content a ) and setContent( SubContent name ),
}
with the mapping file pointing to a Many to one Content class.
Then when i run with Sun's jre, i get a SEVERE exception saying :
SEVERE = Expected type : SubContent, actual value : Content.

I think the JRE is called the second setContent() function for some reason.
Would appreciate any help in how i can resolve this, or information if you have seen the JRE mismatch problem before,

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 5:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
No Persister for : java.lang.Long


This usually happens if your exception handling idiom is wrong! ie. you swallow an exception and keep working with the session.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 11:49 am 
Newbie

Joined: Thu Oct 30, 2003 4:44 pm
Posts: 5
Hi,
I have caught the exception at the first point it occurs and am not reusing the session, i get it at a call to save() or saveOrUpdate().
If it were a mapping problem, it should happen when i use IBM's JRE also, should i move to the 2.1beta5 version of Hibernate.
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 12:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I don't believe you, but if you can reproduce it in a VERY simple main() method, submit it to JIRA and i will take a look.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 3:17 pm 
Newbie

Joined: Thu Oct 30, 2003 4:44 pm
Posts: 5
Hi Gavin,
I was able to recreate it, i have posted the problem on JIRA for Hibernate 2.0, would appreciate your help,
Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 10:02 am 
Newbie

Joined: Thu Oct 30, 2003 4:44 pm
Posts: 5
Hi Gavin,
I have tried both your methods, which are
1) remove overloaded get/set methods or
2) move to 2.1 Hibernate and use access="field"
but i get the same exception in both. I have sent the set of code in a zip file to gavin@hibernate.org, can you take a look.
Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2003 11:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
please don't email me stuff! This is what JIRA is for.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 12:36 pm 
Newbie

Joined: Thu Oct 30, 2003 4:44 pm
Posts: 5
Hi Gavin,
The getFormula/setFormula method was overloaded for Sun's JRE with a isFormula()/isAggregation() method which caused the problem. By renaming the isXXX() methods, i got rid of the problem,
Thanks,


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.