« Return to Thread: Search by ID java.lang.ClassCastException

Search by ID java.lang.ClassCastException

by ghachey :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have been experiencing a problem for a while.  I use:

trails-1.2.2-SNAPSHOT

$ java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-b02, mixed mode)

tomcat5.5 (5.5.26-5) (I also test with tomcat:run and jetty:run from maven)

I have an object model called Complaint.java.  It uses an id of type Long for the primary key.  The whole application works fine except when I try to search for a complaint using the id field I get a java.lang.ClassCastException runtime exception (tapestry error Screenshot.png).  Searching with id works fine for all other objects.

I get the same problem with both hsql and postgresql databases.

A simple test case ComplaintTest.java fails to build with postgresql with this message and fails to build with hsql with this one.

I remember several weeks ago trying to test with an id of type Integer but getting the same error.

Here is what the hibernate generated DB schema for this object looks like.

Any ideas?

--
GH

 « Return to Thread: Search by ID java.lang.ClassCastException