users@glassfish.java.net

RE: ClassCastException when using JPA result (spring 2.5)

From: Manfred Riem <mriem_at_manorrock.org>
Date: Wed, 20 Aug 2008 13:00:14 -0600

I see you are running PostgreSQL? Make sure the case of table name matches
the case you specified in the database. Also, make sure that your driver
is specifying it is a JDBC 3.0 connection.

To verify I would recommend trying it against a Mysql database, if that
one works you know it has to do with the driver somehow.

Manfred

-----Original Message-----
From: Ryan de Laplante [mailto:ryan_at_ijws.com]
Sent: Wednesday, August 20, 2008 12:58 PM
To: users_at_glassfish.dev.java.net
Subject: Re: ClassCastException when using JPA result (spring 2.5)

Yes, see attached source files.


Manfred Riem wrote:
> Did you annotate that object with?
>
> @Entity
> @Table(name="table name")
>
> Manfred
>
> -----Original Message-----
> From: Ryan de Laplante [mailto:ryan_at_ijws.com]
> Sent: Wednesday, August 20, 2008 12:49 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: ClassCastException when using JPA result (spring 2.5)
>
> I made two changes:
>
> 1) set tansaction-type="JTA"
> 2) Removed my <class></class> line and replaced it with
> <exclude-unlisted-classes>false</exclude-unlisted-classes>
>
> I don't get the EJBClassLoader exception anymore, but when I try to
> use my entity I get a different exception:
>
>
>> java.lang.IllegalArgumentException: Object: key=[ryanTest]
>> value=[test
>>
> value] is not a known entity type.
> It used my entitiy's .toString method which output the key/value in
> the exception's message. Anyhow, I have no clue why Spring 2.5.5 works
for
> you with JPA in GlassFish V2 UR2 but not for me. Obviously there are
> class loading problems, and I hope someone from Sun jumps in to help.
>
>
> Thanks,
> Ryan
>
>