-->
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.  [ 5 posts ] 
Author Message
 Post subject: NumberFormatException
PostPosted: Wed Jan 07, 2004 7:42 pm 
Newbie

Joined: Wed Dec 31, 2003 9:45 pm
Posts: 19
When I call criteria.list(), Hibernate now appears to throw a NumberFormatException. I have a logging statement before the offending line which executes correctly, and one after which is never executed. I catch a NumberFormatException in this block, not a Hibernate exception, and my log doesn't show any errors from Hibernate.

Any thoughts on how to look for the problem? The log is pretty long, and I don't know what part of it is relevant, so I doubt posting it is useful to anyone, and my java code hasn't changed from when it worked, so I'm guessing I have a mismatch between the database schema and the mapping file, but don't know how to do debug this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 7:54 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Do you think anyone has idea how to debug this if you do not? :)

Unlike us you can see
1. exception stack trace
2. SQL statement being executed
3. your mapping file
4. your table column data types
3. your class sources

Hint: if you paste at least SOMETHING of it, it would be much easier :)


Top
 Profile  
 
 Post subject: No option in this case, but I found it
PostPosted: Wed Jan 07, 2004 9:08 pm 
Newbie

Joined: Wed Dec 31, 2003 9:45 pm
Posts: 19
Actually, I suspect that yes, someone would have figured this out shortly. I had neglected to put type="yes_no" on one of my boolean fields, and Hibernate tried to convert a 'Y' in the database to a 1. I think Hibernate should be able to trap this and throw an exception, but oh well.

In response to your note, there was no stack trace. My mapping file is a couple thousand lines long, and it was unclear where it was executing without looking at the log output, which was also several thousand lines long. I don't expect others to do this level of debugging for me. I was just hoping someone would have an idea why Hibernate would throw such an exception, or where I should turn. Thanks for the quick response though.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 9:15 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Hey, hey! If you have and exception, you can always make a stack trace :)

Code:
try
{
//...
}
catch (Exception e)
{
    e.printStackTrace();
}


Never mind. I'm glad you solved the issue.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 9:29 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Don't worry, dimas. It's never bad to enforce commen sense. :)


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