openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <>
Subject Please make Exceptions more useful...
Date Wed, 02 Apr 2008 12:46:16 GMT
I just got an error message which said:-

Exception in thread "main" <openjpa-1.0.2-r420667:627158 nonfatal general 
error> org.apache.openjpa.persistence.PersistenceException: java.util.Date 
cannot be cast to java.util.Collection

In this (and the accompanying stack trace) there is no indication which Date
object cannot be cast to a Collection.  Yes from the stack trace I know that
I was trying to persist a particular root object, but I have no idea which 
class and field this error refers to.  Simply adding the class and field would 
make debugging so much easier.

Then once I know which Date field it might be, I can start to try to work out
why it wanted to cast it to a collection.  Presumably this was it was trying
to map this to a particular table, or to a set of objects of a given type, and
again it would be useful to know what application object as opposed to raw
java class it was trying to map to.


View raw message