Using jndi to get a DBCP BasicDataSource give ClassCastException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using jndi to get a DBCP BasicDataSource give ClassCastException

Vijay Anjur
I am trying to cast datasource to BasicDataSource and getting a
classcastException during runtime. I tried to output .getClass().getName()
from the datasource to see what it
thinks I see basicDataSource. I found the following link which is exactly my
problem. Any ideas?

http://mail-archives.apache.org/mod_mbox/tomcat-users/200309.mbox/%3C3F58A597.60904@...%3E
Reply | Threaded
Open this post in threaded view
|

Re: Using jndi to get a DBCP BasicDataSource give ClassCastException

Christian Hufgard
Hello Vijay,


> I am trying to cast datasource to BasicDataSource and getting a
> classcastException during runtime. I tried to output .getClass().getName()
> from the datasource to see what it
> thinks I see basicDataSource. I found the following link which is exactly my
> problem. Any ideas?

On the first look, this might be a Classloader issue. Where do you
have your libraries placed? Maybe you have duplicate classes in the
servers library dir an in WEB-INF/lib?



--
Best regards,
 Christian                            mailto:[hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Using jndi to get a DBCP BasicDataSource give ClassCastException

Vijay Anjur
Hi Christian,
  You are right. The problem was I had duplicates in the WEB-INF/lib.I can't
tell you how long I spent trying to figure this out and I can't thank you
enough for your quick response.

Thanks you very very very much!!!!!!!!!!!!!!

On 3/6/06, Christian Hufgard <[hidden email]> wrote:

>
> Hello Vijay,
>
>
> > I am trying to cast datasource to BasicDataSource and getting a
> > classcastException during runtime. I tried to output
> .getClass().getName()
> > from the datasource to see what it
> > thinks I see basicDataSource. I found the following link which is
> exactly my
> > problem. Any ideas?
>
> On the first look, this might be a Classloader issue. Where do you
> have your libraries placed? Maybe you have duplicate classes in the
> servers library dir an in WEB-INF/lib?
>
>
>
> --
> Best regards,
> Christian                            mailto:[hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>