tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parsons Technical Services" <parsonstechni...@earthlink.net>
Subject Re: In tomcat 5.0.19 doesn't found the driver into the localhost declaration but yes into one virtual domain
Date Sun, 02 May 2004 02:13:12 GMT
> this doesn't run:
> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs"
> prefix="localhost_log." suffix=".txt" timestamp="true"/>
> <Resource name="jdbc/ServiciosNvolucion" auth="Container"
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/ServiciosNvolucion">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
------SNIP----
> </ResourceParams>
> </Host>

No it won't. You need to define the resource in either a context(as you have
below) to be available only for that context or in a GlobalNamingResources
which must be nested in a service which will make it available to all apps.
.


In the default server.xml there is a GlobalNamingResource with a variable
defined. Move the Resource and ResourceParams into there.

See:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html

You will need to provide a link in a context for that context to be able to
access the resource.

Example:
<ResourceLink name="jdbc/ServiciosNvolucion"
                 global="jdbc/ServiciosNvolucion"
                 type="javax.sql.DataSource" />



> and this runs well:
> <Host name="pruebas.virtual.com" debug="0" appBase="webapps/other_site"
> unpackWARs="true" autoDeploy="true" xmlValidation="false"
> xmlNamespaceAware="false">
> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs"
> prefix="ff_log." suffix=".txt" timestamp="true"/>
> <Context path="" docBase="" reloadable="true" crossContext="true">
> <Resource name="jdbc/ServiciosNvolucion" auth="Container"
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/ServiciosNvolucion">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>org.postgresql.Driver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:postgresql://192.168.1.100:5432/bd</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>dd</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>user</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>100</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>20</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>-1</value>
> </parameter>
> <parameter>
> <name>removeAbandoned</name>
> <value>true</value>
> </parameter>
> <parameter>
> <name>removeAbandonedTimeout</name>
> <value>300</value>
> </parameter>
> <parameter>
> <name>logAbandoned</name>
> <value>true</value>
> </parameter>
> </ResourceParams>
> </Context>
> </Host>
>
>
> can anybody helps me please?
> thanks
> ----- Original Message ----- 
> From: "Parsons Technical Services" <parsonstechnical@earthlink.net>
> To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
> Sent: Saturday, May 01, 2004 3:11 AM
> Subject: Re: In tomcat 5.0.19 doesn't found the driver
>
>
> > Please post your TC5 config files:
> > server.xml
> > web.xml
> > context.xml of app or context if not in server.xml
> >
> > Doug
> > www.parsonstechnical.com
> >
> > ----- Original Message ----- 
> > From: "Dionisio Ruiz de Zárate" <dionisio@tinieblas.com>
> > To: <tomcat-user@jakarta.apache.org>
> > Sent: Friday, April 30, 2004 5:38 PM
> > Subject: In tomcat 5.0.19 doesn't found the driver
> >
> >
> > > Hello y have one great problem.
> > > with the bellow code i try to connect to one pstgresql database using
> the
> > > jakarta pool connection.
> > > Using tomcat 4.1.30 it runs well but if i try to run into one tomcat
> > 5.0.19
> > > the systems says me the bellow error, It doesn't found the driver.
> > > I have put the jar file into the common\lib directory.
> > >
> > > Can you help me?
> > > thanks
> > >
> > > private Connection conn;
> > >     private HttpSession userSession;
> > >     private HashMap userInfo = new HashMap();
> > >     private ServletContext context;
> > >     private Driver drv;
> > >     Context initContext;
> > >     Context envContext;
> > >     DataSource ds;
> > > .........
> > >  try{
> > >             ds = (DataSource)envContext.lookup("jdbc/"+bd);
> > >             System.out.println("DATABASE: " + bd);
> > >             if(ds==null){
> > >                 throw new Exception("BEEEEEEEEEEEEMMM -------- ds " +
> > > propietarioServicio);
> > >             }
> > >         }catch(Exception e){
> > >             System.out.println("Excepcion en el context ini3 "  +
> > > propietarioServicio + " es " + e);
> > >         }
> > >         try{
> > >             conn=ds.getConnection();
> > >         }catch(Exception e){
> > >             System.out.println("Excepcion en el context ini4: " +
> > > propietarioServicio + " es " + e);
> > >             e.printStackTrace();
> > >         }
> > > .......
> > >
> > >
> > > ERROR:
> > >
> > >
> > > Excepcion en el context ini4: bti es
> > > org.apache.commons.dbcp.SQLNestedException:
> > >  Cannot create JDBC driver of class '' for connect URL 'null', cause:
No
> > > suitabl
> > > e driver
> > > org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
of
> > > class '
> > > ' for connect URL 'null', cause:
> > > java.sql.SQLException: No suitable driver
> > >         at java.sql.DriverManager.getDriver(DriverManager.java:243)
> > >         at
> > > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
> > > rce.java:743)
> > >         at
> > > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
> > > .java:518)
> > >         at
> > > com.nvolucion.accionesdatabase.ConectaDesconectaBaseDatos.conecta(Con
> > > ectaDesconectaBaseDatos.java:104)
> > >         at
> > > com.nvolucion.accionesdatabase.ConectaDesconectaBaseDatos.dameConexio
> > > n(ConectaDesconectaBaseDatos.java:47)
> > >         at
> > > com.nvolucion.accionestxomin.ConsultasAdministracionTxomin.selectCamp
> > > o(ConsultasAdministracionTxomin.java:115)
> > >         at
> > com.nvolucion.LaEntrada.verAyudaBreveGestor(LaEntrada.java:2332)
> > >         at
> > org.apache.jsp.gestion.login_jsp._jspService(login_jsp.java:161)
> > >         at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >         at
> > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
> > > .java:311)
> > >         at
> > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
> > > 01)
> > >         at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> > > icationFilterChain.java:284)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> > > ilterChain.java:204)
> > >         at
> > > com.nvolucion.utils.FiltroSessiones.doFilter(FiltroSessiones.java:160
> > > )
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> > > icationFilterChain.java:233)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> > > ilterChain.java:204)
> > >         at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> > > alve.java:257)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
> > > ContextValve.java:245)
> > >         at
> > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> > > alve.java:199)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> > > ava:184)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> > > ava:164)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:149)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> > > ve.java:156)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
> > >
> > >         at
> > > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
> > > 6)
> > >         at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> > > :833)
> > >         at
> > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
> > > ssConnection(Http11Protocol.java:732)
> > >         at
> > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
> > > :619)
> > >         at
> > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
> > > ool.java:688)
> > >         at java.lang.Thread.run(Thread.java:534)
> > > java.lang.NullPointerException
> > >         at
> > > com.nvolucion.accionestxomin.ConsultasAdministracionTxomin.selectCamp
> > > o(ConsultasAdministracionTxomin.java:124)
> > >         at
> > com.nvolucion.LaEntrada.verAyudaBreveGestor(LaEntrada.java:2332)
> > >         at
> > org.apache.jsp.gestion.login_jsp._jspService(login_jsp.java:161)
> > >         at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >         at
> > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
> > > .java:311)
> > >         at
> > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
> > > 01)
> > >         at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> > > icationFilterChain.java:284)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> > > ilterChain.java:204)
> > >         at
> > > com.nvolucion.utils.FiltroSessiones.doFilter(FiltroSessiones.java:160
> > > )
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> > > icationFilterChain.java:233)
> > >         at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> > > ilterChain.java:204)
> > >         at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> > > alve.java:257)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
> > > ContextValve.java:245)
> > >         at
> > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> > > alve.java:199)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> > > ava:184)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> > > ava:164)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:149)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> > > ve.java:156)
> > >         at
> > > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
> > > eContext.java:151)
> > >         at
> > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > > a:567)
> > >         at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
> > >
> > >         at
> > > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
> > > 6)
> > >         at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message