tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Pizzolotto" <...@extraweb.it>
Subject Re: ClassCastException
Date Wed, 03 Oct 2001 14:07:58 GMT
sure :)
WEB.XML
################################################################
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<resource-ref>
  <res-ref-name>jdbc/domus</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
</web-app>
#############################################################
SERVER.XML
##############################################################à
 <Context path="/domus" docBase="domus" debug="0" reloadable="true">
    <Resource name="jdbc/domus" auth="Container"
type="javax.sql.DataSource"/>
   <ResourceParams name="jdbc/domus">
    <parameter>
        <name>user</name>
        <value>user</value>
    </parameter>

      <parameter>
        <name>password</name>
        <value>password</value>
    </parameter>
    <parameter>
        <name>driverClassName</name>
        <value>weblogic.jdbc.mssqlserver4.Driver</value>
    </parameter>
    <parameter>
        <name>driverName</name>
        <value>jdbc:weblogic:mssqlserver4:domus@localhost:1433</value>
    </parameter>
   </ResourceParams>
 </Context>
##################################################


i tink that this part is correct ??

----- Original Message -----
From: "Will Stranathan" <will@thestranathans.com>
To: <tomcat-dev@jakarta.apache.org>
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(JspServlet.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(Application
FilterChain.java:247)
> >  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
> >  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
> >  at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.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(StandardContextValve.ja
va:215)
> >  at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.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(StandardHostValve.java:164
)
> >  at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
> >  at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> >  at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.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(StandardEngineValve.java
:163)
> >  at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.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(HttpProcessor.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
> >
> >
>
>
>


Mime
View raw message