Classes loaded from two different
classloaders are not the same classes.
From: Brian Engel
[mailto:Brian.Engel@xxxxxxxxxxxx]
Sent: Thursday, August 18, 2005
2:58 PM
To: users@xxxxxxxxxx
Subject: RE: [cinjug-users]
Oracle, Tomcat and Connection Pooling.
Thanks everyone, James was right it was a
classloader issue. I had the oracle jar both in the common/lib and the
WEB-INF/lib. I removed the jar from the WEB-INF/lib and the problem went away.
Guess the tomcat JNDI connection pool uses the common jar while my application
would use the one in the WEB-INF/lib.
Not sure what there would be a
ClassCastException though, since the jars and classes within them are identical...
But I do not know too much of the details of classloaders....
From: Eric
Bardes [mailto:ericbardes@xxxxxxxxx]
Sent: Thursday, August 18, 2005
2:37 PM
To: Brian Engel
Cc: users@xxxxxxxxxx
Subject: Re: [cinjug-users]
Oracle, Tomcat and Connection Pooling.
Tomcat creates a wraps
the Oracle class (or any other data source) with it's own class and returns
that. As I understand it, it allows for better pool management. It
know it checks for orphan, idle and invalid connections.
Try changing OracleDataSource to just DataSource.
On 18/08/05, Brian
Engel <Brian.Engel@xxxxxxxxxxxx>
wrote:
Wondering if anyone has encountered this problem, it is
driving crazy.
Basically I trying to setup a connection pool with Tomcat
(4.1.30) using Oracle's data source factory (et al).
The issue is I am getting a ClassCastException when I
attempt to cast the object retrieved via the JNDI lookup.
--
Cheers,
Eric Bardes