I had exactly this problem; but I had jdbc2_0-stdext.jar not in the jre/lib/ext but in my webapp/web-inf/lib directory. Putting jdbc2_0-stdext.jar in common/lib along with the tyrex files solved the problem (classloaders, you gotta love 'em)
Kevin Jones Developmentor www.develop.com > -----Original Message----- > From: craigmcc@localhost [mailto:craigmcc@localhost]On Behalf Of Craig > R. McClanahan > Sent: 03 October 2001 17:20 > To: [EMAIL PROTECTED] > Subject: Re: ClassCastException > > > > > On Wed, 3 Oct 2001, Alessandro Pizzolotto wrote: > > > Date: Wed, 3 Oct 2001 17:10:37 +0200 > > From: Alessandro Pizzolotto <[EMAIL PROTECTED]> > > Reply-To: [EMAIL PROTECTED] > > To: [EMAIL PROTECTED] > > Subject: Re: ClassCastException > > > > hehehe > > if i use this class: > > tyrex.jdbc.xa.EnabledDataSource > > instead > > javax.sql.DataSource > > the program works fine > > the problem is that EnableDataSource implements > javax.sql.DataSource but i > > can't cast javax.sql.DataSource. > > why ??? > > > > Would you happen to have a copy of jdbc2_0-stdext.jar in your system > extensions directory ($JAVA_HOME/jre/lib/ext)? That would cause problems > like this -- the same sort of problem that causes "Class foo is not a > servlet" errors if you have servlet.jar there. > > > Alessandro > > Craig McClanahan > > > ----- Original Message ----- > > From: "Will Stranathan" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, October 03, 2001 3:04 PM > > Subject: Re: ClassCastException > > > > > > > Can we see the appropriate parts of server.xml and web.xml? > > > > > > Will Stranathan > > > > > > Alessandro Pizzolotto wrote: > > > > > > > this code > > > > > > > > javax.naming.Context ctx = new javax.naming.InitialContext(); > > > > javax.naming.Context cto = > > (javax.naming.Context)ctx.lookup("java:/comp/env"); > > > > javax.sql.DataSource ds = > > (javax.sql.DataSource)cto.lookup("jdbc/domus"); > > > > > > > > produce this error > > > > > > > > java.lang.ClassCastException: tyrex.jdbc.xa.EnabledDataSource > > > > at org.apache.jsp.ricerca3$jsp._jspService(ricerca3$jsp.java:74) > > > > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264) > > > > at > > > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp > Servlet.ja > > va:201) > > > > at > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) > > > > at > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:1264) > > > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A > pplication > > FilterChain.java:247) > > > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati > onFilterCh > > ain.java:193) > > > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp > erValve.ja > > va:243) > > > > at > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel > ine.java:5 > > 66) > > > > at > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline. > java:472) > > > > at > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardConte > xtValve.ja > > va:215) > > > > at > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel > ine.java:5 > > 66) > > > > at > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline. > java:472) > > > > at > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > > > at > > > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2366) > > > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValv > e.java:164 > > ) > > > > at > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel > ine.java:5 > > 66) > > > > at > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) > > > > at > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel > ine.java:5 > > 64) > > > > at > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline. > java:472) > > > > at > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine > Valve.java > > :163) > > > > at > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel > ine.java:5 > > 66) > > > > at > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline. > java:472) > > > > at > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > > > at > > > org.apache.catalina.connector.http.HttpProcessor.process(HttpProce > ssor.java: > > 1005) > > > > at > > > org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor > .java:1098 > > ) > > > > at java.lang.Thread.run(Thread.java:484) > > > > > > > > the code not get the cast in DataSource > > > > why ? > > > > tanks > > > > Alessadro > > > > > > > > > > > > > > > > > > > > > >