You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sevillano sevi llano <se...@hotmail.com> on 2005/04/15 11:34:40 UTC

can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28

I´m following this documentation:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

"...Add this in between the </Context> tag of the examples context and the 
</Host> tag closing the localhost definition..."
but there is no </Context> in my server.xml

also I´ver read tons of forums about this question, and I´ve tested a lot of 
different configuration.

this is the error I´ve got (the usual I think):
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'



any help please? I´ve been the whole week trying to fix it

thanks




these are my files:

SERVER.XML

<Server port="8005" shutdown="SHUTDOWN">


  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
      description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>


	<Resource name="jdbc/myoracle" auth="Container" 
type="javax.sql.DataSource"/>
	<ResourceParams name="jdbc/myoracle">
	   
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
	   <parameter><name>username</name><value>***</value></parameter>
	   <parameter><name>password</name><value>***</value></parameter>
	   
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
	   
<parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
	   <parameter><name>removeAbandoned</name><value>false</value></parameter>
	   
<parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
	   <parameter><name>logAbandoned</name><value>true</value></parameter>
	   <parameter><name>maxActive</name><value>10</value></parameter>
	</ResourceParams>


  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />

      <Host name="localhost" appBase="webapps" />
    </Engine>
  </Service>
</Server>



WEB.XML

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Tomcat
  </description>

	<resource-ref>
		<res-ref-name>jdbc/myoracle</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>

</web-app>




TEST.JSP

...
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
conn = ds.getConnection();
...

_________________________________________________________________
Descarga gratis la Barra de Herramientas de MSN 
http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH


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


Re: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Ben Kim <bk...@coe.tamu.edu>.

>> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>> class '' for connect URL 'null'

I may be wrong, but I had a similar situation, and in my case when I set
up the "Data Sources" for the application context (not as the
GlobalNamingResources in server.xml) using the admin page, that error went
away.

If admin page is not your preference, supposing the context name is
"mycontext", the configuration can go in
$CATALINA_HOME/conf/Catalina/localhost/mycontext.xml.

HTH.


Ben Kim
Database Developer/Systems Administrator
434E Harrington Tower / College of Education 
Texas A&M University



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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Anto Paul <an...@gmail.com>.
On 4/15/05, Sevillano sevi llano <se...@hotmail.com> wrote:
> Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
> 
> I´m following this documentation:
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> 
> "...Add this in between the </Context> tag of the examples context and the
> </Host> tag closing the localhost definition..."
> but there is no </Context> in my server.xml
> 
> also I´ver read tons of forums about this question, and I´ve tested a lot of
> different configuration.
> 
> this is the error I´ve got (the usual I think):
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '' for connect URL 'null'
> 
> any help please? I´ve been the whole week trying to fix it
> 
> thanks
> 
> these are my files:
> 
> SERVER.XML
> 
> <Server port="8005" shutdown="SHUTDOWN">
> 
>   <GlobalNamingResources>
>     <!-- Used by Manager webapp -->
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>       description="User database that can be updated and saved">
>     </Resource>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
>         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
> 
>         <Resource name="jdbc/myoracle" auth="Container"
> type="javax.sql.DataSource"/>
>         <ResourceParams name="jdbc/myoracle">
> 
> <parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>            <parameter><name>username</name><value>***</value></parameter>
>            <parameter><name>password</name><value>***</value></parameter>
> 
> <parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> 
> <parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>            <parameter><name>removeAbandoned</name><value>false</value></parameter>
> 
> <parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>            <parameter><name>logAbandoned</name><value>true</value></parameter>
>            <parameter><name>maxActive</name><value>10</value></parameter>
>         </ResourceParams>
> 
>   </GlobalNamingResources>
> 
>   <Service name="Catalina">
>     <Connector port="8080" />
> 
>     <!-- This is here for compatibility only, not required -->
>     <Connector port="8009" protocol="AJP/1.3" />
> 
>     <Engine name="Catalina" defaultHost="localhost">
>       <Logger className="org.apache.catalina.logger.FileLogger" />
> 
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase" />
> 
>       <Host name="localhost" appBase="webapps" />
>     </Engine>
>   </Service>
> </Server>
> 
> WEB.XML
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>     version="2.4">
> 
>   <display-name>Welcome to Tomcat</display-name>
>   <description>
>      Welcome to Tomcat
>   </description>
> 
>         <resource-ref>
>                 <res-ref-name>jdbc/myoracle</res-ref-name>
>                 <res-type>javax.sql.DataSource</res-type>
>                 <res-auth>Container</res-auth>
>         </resource-ref>
> 
> </web-app>
> 
> TEST.JSP
> 
> ...
> Context initContext = new InitialContext();
> Context envContext  = (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
> conn = ds.getConnection();
> ...
> 
> _________________________________________________________________
> Descarga gratis la Barra de Herramientas de MSN
> http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
You have the Oracle JDBC driver in place. I think best place is
common\lib. You have rename the zip file to jar.

-- 
Anto Paul

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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Sevillano sevi llano <se...@hotmail.com>.
Hi Caroline

it works perfectly now!!

thanks very much for your help

I love you!!

:-)

>From: Caroline Jen <ji...@yahoo.com>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: Tomcat Users List <to...@jakarta.apache.org>
>Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 07:47:11 -0700 (PDT)
>
>Hi Sevillano,
>
>    I inserted the configuration after the last <Realm
>..../> tag and before the <Host ... >tage (see below)
>in the $TOMCAT/config/server.xml file.  This is my
>configuration (sorry, I should have shown it in my
>previous posting).  Let us see if it works:
>
>       <!--
>       <Realm
>className="org.apache.catalina.realm.JDBCRealm"
>debug="99"
>              driverName="sun.jdbc.odbc.JdbcOdbcDriver"
>           connectionURL="jdbc:odbc:CATALINA"
>               userTable="users"
>userNameCol="user_name" userCredCol="user_pass"
>           userRoleTable="user_roles"
>roleNameCol="role_name" />
>       -->
>
>       <!-- Define the default virtual host
>            Note: XML Schema validation will not work
>with Xerces 2.2.
>        -->
>
><!-- The DefaultContext segment and its elements below
>are added by Caroline Jen -->
>
><DefaultContext>
>    <Resource name="jdbc/OracleDB" auth="Container"
>              type="javax.sql.DataSource"/>
>
>    <ResourceParams name="jdbc/OracleDB">
>       <parameter>
>          <name>factory</name>
>
><value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>       </parameter>
>       <parameter>
>          <name>maxWait</name>
>          <value>-1</value>
>       </parameter>
>       <parameter>
>          <name>maxActive</name>
>          <value>20</value>
>       </parameter>
>       <parameter>
>          <name>password</name>
>          <value>javadude</value>
>       </parameter>
>       <parameter>
>          <name>url</name>
>
><value>jdbc:oracle:thin:@bigbird:1522:dcapes</value>
>       </parameter>
>       <parameter>
>          <name>driverClassName</name>
>
><value>oracle.jdbc.driver.OracleDriver</value>
>       </parameter>
>       <parameter>
>          <name>maxIdle</name>
>          <value>10</value>
>       </parameter>
>       <parameter>
>          <name>username</name>
>          <value>javauser</value>
>       </parameter>
>       <parameter>
>          <name>removeAbandoned</name>
>          <value>true</value>
>       </parameter>
>       <parameter>
>          <name>removeAbandonedTimeout</name>
>          <value>60</value>
>       </parameter>
>       <parameter>
>          <name>logAbandoned</name>
>          <value>true</value>
>       </parameter>
></ResourceParams>
></DefaultContext>
>
><!-- The DefaultContext segment and its elements above
>are added by Caroline Jen -->
>
>       <Host name="localhost" debug="0"
>appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false"
>xmlNamespaceAware="false">
>
>         <!-- The line below is added by Caroline Jen
>-->
>
>         <DefaultContext reloadable="true"/>
>
>         <!-- Defines a cluster for this node,
>              By defining this element, means that
>every manager will be changed.
>              So when running a cluster
>
>-Caroline
>--- Sevillano sevi llano <se...@hotmail.com>
>wrote:
>
> > but...
> >
> > where do I add the Context exactly?
> >
> > this is my server.xml, If I add context, tomcat
> > doesn´t start
> >
> >
> > thanks
> >
> > <Server port="8005" shutdown="SHUTDOWN">
> >   <GlobalNamingResources>
> >     <!-- Used by Manager webapp -->
> >     <Resource name="UserDatabase" auth="Container"
> >
> > type="org.apache.catalina.UserDatabase"
> >       description="User database that can be updated
> > and saved">
> >     </Resource>
> >     <ResourceParams name="UserDatabase">
> >       <parameter>
> >         <name>factory</name>
> >
> >
><value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >       </parameter>
> >       <parameter>
> >         <name>pathname</name>
> >         <value>conf/tomcat-users.xml</value>
> >       </parameter>
> >     </ResourceParams>
> >   </GlobalNamingResources>
> >
> >   <Service name="Catalina">
> >     <Connector port="8080" />
> >
> >     <!-- This is here for compatibility only, not
> > required -->
> >     <Connector port="8009" protocol="AJP/1.3" />
> >
> >     <Engine name="Catalina" defaultHost="localhost">
> >       <Logger
> > className="org.apache.catalina.logger.FileLogger" />
> >
> >       <Realm
> >
>className="org.apache.catalina.realm.UserDatabaseRealm"
> >              resourceName="UserDatabase" />
> >       <Host name="localhost" appBase="webapps"/>
> >     </Engine>
> >   </Service>
> > </Server>
> >
> >
> >
> >
> > >From: "Parsons Technical Services"
> > <pa...@earthlink.net>
> > >Reply-To: "Tomcat Users List"
> > <to...@jakarta.apache.org>
> > >To: "Tomcat Users List"
> > <to...@jakarta.apache.org>
> > >Subject: Re: can´t Configurate Database Connection
> > Pool (DBCP) with Tomcat
> > >5.0.28
> > >Date: Fri, 15 Apr 2005 07:56:36 -0400
> > >
> > >Do you have your resource link in the context
> > element? And if you don't
> > >have a context for the app you need to create one.
> > >
> > >Doug
> > >
> > >
> > >----- Original Message ----- From: "Sevillano sevi
> > llano"
> > ><se...@hotmail.com>
> > >To: <to...@jakarta.apache.org>
> > >Sent: Friday, April 15, 2005 5:34 AM
> > >Subject: can´t Configurate Database Connection Pool
> > (DBCP) with Tomcat
> > >5.0.28
> > >
> > >
> > >>Hi, I´m a newbie trying to configurate DBCP with
> > Tomcat 5.0.28
> > >>
> > >>I´m following this documentation:
> >
> >>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> > >>
> > >>"...Add this in between the </Context> tag of the
> > examples context and the
> > >></Host> tag closing the localhost definition..."
> > >>but there is no </Context> in my server.xml
> > >>
> > >>also I´ver read tons of forums about this
> > question, and I´ve tested a lot
> > >>of different configuration.
> > >>
> > >>this is the error I´ve got (the usual I think):
> > >>org.apache.commons.dbcp.SQLNestedException: Cannot
> > create JDBC driver of
> > >>class '' for connect URL 'null'
> > >>
> > >>
> > >>
> > >>any help please? I´ve been the whole week trying
> > to fix it
> > >>
> > >>thanks
> > >>
> > >>
> > >>
> > >>
> > >>these are my files:
> > >>
> > >>SERVER.XML
> > >>
> > >><Server port="8005" shutdown="SHUTDOWN">
> > >>
> > >>
> > >>  <GlobalNamingResources>
> > >>    <!-- Used by Manager webapp -->
> > >>    <Resource name="UserDatabase" auth="Container"
> > >>
> > type="org.apache.catalina.UserDatabase"
> > >>      description="User database that can be
> > updated and saved">
> > >>    </Resource>
> > >>    <ResourceParams name="UserDatabase">
> > >>      <parameter>
> > >>        <name>factory</name>
> > >>
> >
><value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> > >>      </parameter>
> > >>      <parameter>
> > >>        <name>pathname</name>
> > >>        <value>conf/tomcat-users.xml</value>
> > >>      </parameter>
> > >>    </ResourceParams>
> > >>
> > >>
> > >><Resource name="jdbc/myoracle" auth="Container"
> > >>type="javax.sql.DataSource"/>
> > >><ResourceParams name="jdbc/myoracle">
> > >>
> >
> >><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
> > >>
> >
><parameter><name>username</name><value>***</value></parameter>
> > >>
> >
><parameter><name>password</name><value>***</value></parameter>
> > >>
> >
> >><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> > >>
> >
> >><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
> > >>
> >
> >><parameter><name>removeAbandoned</name><value>false</value></parameter>
> > >>
> >
> >><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
> > >>
> >
><parameter><name>logAbandoned</name><value>true</value></parameter>
> > >>
> >
><parameter><name>maxActive</name><value>10</value></parameter>
> > >></ResourceParams>
> > >>
> > >>
> > >>  </GlobalNamingResources>
> > >>
> > >>  <Service name="Catalina">
> > >>    <Connector port="8080" />
> > >>
> > >>    <!-- This is here for compatibility only, not
> > required -->
> > >>    <Connector port="8009" protocol="AJP/1.3" />
> > >>
> > >>    <Engine name="Catalina"
> > defaultHost="localhost">
> > >>      <Logger
> > className="org.apache.catalina.logger.FileLogger" />
> > >>
> > >>      <Realm
> >
>className="org.apache.catalina.realm.UserDatabaseRealm"
> > >>             resourceName="UserDatabase" />
> > >>
> > >>      <Host name="localhost" appBase="webapps" />
> > >>    </Engine>
> > >>  </Service>
> > >></Server>
> > >>
> > >>
> > >>
> > >>WEB.XML
> > >>
> > >><?xml version="1.0" encoding="ISO-8859-1"?>
> > >>
> > >><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> > >>
> >
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > >>
> > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > >>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> > >>    version="2.4">
> > >>
> >
>=== message truncated ===
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>

_________________________________________________________________
Acepta el reto MSN Premium: Protección para tus hijos en internet. 
Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil


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


Re: can�t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Caroline Jen <ji...@yahoo.com>.
Hi Sevillano,

   I inserted the configuration after the last <Realm
..../> tag and before the <Host ... >tage (see below)
in the $TOMCAT/config/server.xml file.  This is my
configuration (sorry, I should have shown it in my
previous posting).  Let us see if it works:

      <!--
      <Realm 
className="org.apache.catalina.realm.JDBCRealm"
debug="99"
             driverName="sun.jdbc.odbc.JdbcOdbcDriver"
          connectionURL="jdbc:odbc:CATALINA"
              userTable="users"
userNameCol="user_name" userCredCol="user_pass"
          userRoleTable="user_roles"
roleNameCol="role_name" />
      -->

      <!-- Define the default virtual host
           Note: XML Schema validation will not work
with Xerces 2.2.
       -->

<!-- The DefaultContext segment and its elements below
are added by Caroline Jen -->

<DefaultContext>
   <Resource name="jdbc/OracleDB" auth="Container"
             type="javax.sql.DataSource"/> 

   <ResourceParams name="jdbc/OracleDB">
      <parameter>
         <name>factory</name>
        
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
         <name>maxWait</name>
         <value>-1</value>
      </parameter>
      <parameter>
         <name>maxActive</name>
         <value>20</value>
      </parameter>
      <parameter>
         <name>password</name>
         <value>javadude</value>
      </parameter>
      <parameter>
         <name>url</name>
        
<value>jdbc:oracle:thin:@bigbird:1522:dcapes</value>
      </parameter>
      <parameter>
         <name>driverClassName</name>
        
<value>oracle.jdbc.driver.OracleDriver</value>
      </parameter>
      <parameter>
         <name>maxIdle</name>
         <value>10</value>
      </parameter>
      <parameter>
         <name>username</name>
         <value>javauser</value>
      </parameter>
      <parameter>
         <name>removeAbandoned</name>
         <value>true</value>
      </parameter>
      <parameter>
         <name>removeAbandonedTimeout</name>
         <value>60</value>
      </parameter>
      <parameter>
         <name>logAbandoned</name>
         <value>true</value>
      </parameter>
</ResourceParams>
</DefaultContext>

<!-- The DefaultContext segment and its elements above
are added by Caroline Jen -->

      <Host name="localhost" debug="0"
appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false"
xmlNamespaceAware="false">

        <!-- The line below is added by Caroline Jen
-->

        <DefaultContext reloadable="true"/>

        <!-- Defines a cluster for this node,
             By defining this element, means that
every manager will be changed.
             So when running a cluster

-Caroline
--- Sevillano sevi llano <se...@hotmail.com>
wrote:

> but...
> 
> where do I add the Context exactly?
> 
> this is my server.xml, If I add context, tomcat
> doesn�t start
> 
> 
> thanks
> 
> <Server port="8005" shutdown="SHUTDOWN">
>   <GlobalNamingResources>
>     <!-- Used by Manager webapp -->
>     <Resource name="UserDatabase" auth="Container"
>              
> type="org.apache.catalina.UserDatabase"
>       description="User database that can be updated
> and saved">
>     </Resource>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
>        
>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
>   </GlobalNamingResources>
> 
>   <Service name="Catalina">
>     <Connector port="8080" />
> 
>     <!-- This is here for compatibility only, not
> required -->
>     <Connector port="8009" protocol="AJP/1.3" />
> 
>     <Engine name="Catalina" defaultHost="localhost">
>       <Logger
> className="org.apache.catalina.logger.FileLogger" />
> 
>       <Realm
>
className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase" />
>       <Host name="localhost" appBase="webapps"/>
>     </Engine>
>   </Service>
> </Server>
> 
> 
> 
> 
> >From: "Parsons Technical Services"
> <pa...@earthlink.net>
> >Reply-To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> >To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> >Subject: Re: can�t Configurate Database Connection
> Pool (DBCP) with Tomcat 
> >5.0.28
> >Date: Fri, 15 Apr 2005 07:56:36 -0400
> >
> >Do you have your resource link in the context
> element? And if you don't 
> >have a context for the app you need to create one.
> >
> >Doug
> >
> >
> >----- Original Message ----- From: "Sevillano sevi
> llano" 
> ><se...@hotmail.com>
> >To: <to...@jakarta.apache.org>
> >Sent: Friday, April 15, 2005 5:34 AM
> >Subject: can�t Configurate Database Connection Pool
> (DBCP) with Tomcat 
> >5.0.28
> >
> >
> >>Hi, I�m a newbie trying to configurate DBCP with
> Tomcat 5.0.28
> >>
> >>I�m following this documentation:
>
>>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> >>
> >>"...Add this in between the </Context> tag of the
> examples context and the 
> >></Host> tag closing the localhost definition..."
> >>but there is no </Context> in my server.xml
> >>
> >>also I�ver read tons of forums about this
> question, and I�ve tested a lot 
> >>of different configuration.
> >>
> >>this is the error I�ve got (the usual I think):
> >>org.apache.commons.dbcp.SQLNestedException: Cannot
> create JDBC driver of 
> >>class '' for connect URL 'null'
> >>
> >>
> >>
> >>any help please? I�ve been the whole week trying
> to fix it
> >>
> >>thanks
> >>
> >>
> >>
> >>
> >>these are my files:
> >>
> >>SERVER.XML
> >>
> >><Server port="8005" shutdown="SHUTDOWN">
> >>
> >>
> >>  <GlobalNamingResources>
> >>    <!-- Used by Manager webapp -->
> >>    <Resource name="UserDatabase" auth="Container"
> >>             
> type="org.apache.catalina.UserDatabase"
> >>      description="User database that can be
> updated and saved">
> >>    </Resource>
> >>    <ResourceParams name="UserDatabase">
> >>      <parameter>
> >>        <name>factory</name>
> >>       
>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >>      </parameter>
> >>      <parameter>
> >>        <name>pathname</name>
> >>        <value>conf/tomcat-users.xml</value>
> >>      </parameter>
> >>    </ResourceParams>
> >>
> >>
> >><Resource name="jdbc/myoracle" auth="Container" 
> >>type="javax.sql.DataSource"/>
> >><ResourceParams name="jdbc/myoracle">
> >>
>
>><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
> >>   
>
<parameter><name>username</name><value>***</value></parameter>
> >>   
>
<parameter><name>password</name><value>***</value></parameter>
> >>
>
>><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> >>
>
>><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
> >>    
>
>><parameter><name>removeAbandoned</name><value>false</value></parameter>
> >>
>
>><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
> >>   
>
<parameter><name>logAbandoned</name><value>true</value></parameter>
> >>   
>
<parameter><name>maxActive</name><value>10</value></parameter>
> >></ResourceParams>
> >>
> >>
> >>  </GlobalNamingResources>
> >>
> >>  <Service name="Catalina">
> >>    <Connector port="8080" />
> >>
> >>    <!-- This is here for compatibility only, not
> required -->
> >>    <Connector port="8009" protocol="AJP/1.3" />
> >>
> >>    <Engine name="Catalina"
> defaultHost="localhost">
> >>      <Logger
> className="org.apache.catalina.logger.FileLogger" />
> >>
> >>      <Realm
>
className="org.apache.catalina.realm.UserDatabaseRealm"
> >>             resourceName="UserDatabase" />
> >>
> >>      <Host name="localhost" appBase="webapps" />
> >>    </Engine>
> >>  </Service>
> >></Server>
> >>
> >>
> >>
> >>WEB.XML
> >>
> >><?xml version="1.0" encoding="ISO-8859-1"?>
> >>
> >><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> >>   
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>   
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> >>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> >>    version="2.4">
> >>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Sevillano sevi llano <se...@hotmail.com>.
but...

where do I add the Context exactly?

this is my server.xml, If I add context, tomcat doesn´t start


thanks

<Server port="8005" shutdown="SHUTDOWN">
  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
      description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />
      <Host name="localhost" appBase="webapps"/>
    </Engine>
  </Service>
</Server>




>From: "Parsons Technical Services" <pa...@earthlink.net>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 07:56:36 -0400
>
>Do you have your resource link in the context element? And if you don't 
>have a context for the app you need to create one.
>
>Doug
>
>
>----- Original Message ----- From: "Sevillano sevi llano" 
><se...@hotmail.com>
>To: <to...@jakarta.apache.org>
>Sent: Friday, April 15, 2005 5:34 AM
>Subject: can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>
>
>>Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
>>
>>I´m following this documentation:
>>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
>>
>>"...Add this in between the </Context> tag of the examples context and the 
>></Host> tag closing the localhost definition..."
>>but there is no </Context> in my server.xml
>>
>>also I´ver read tons of forums about this question, and I´ve tested a lot 
>>of different configuration.
>>
>>this is the error I´ve got (the usual I think):
>>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
>>class '' for connect URL 'null'
>>
>>
>>
>>any help please? I´ve been the whole week trying to fix it
>>
>>thanks
>>
>>
>>
>>
>>these are my files:
>>
>>SERVER.XML
>>
>><Server port="8005" shutdown="SHUTDOWN">
>>
>>
>>  <GlobalNamingResources>
>>    <!-- Used by Manager webapp -->
>>    <Resource name="UserDatabase" auth="Container"
>>              type="org.apache.catalina.UserDatabase"
>>      description="User database that can be updated and saved">
>>    </Resource>
>>    <ResourceParams name="UserDatabase">
>>      <parameter>
>>        <name>factory</name>
>>        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>>      </parameter>
>>      <parameter>
>>        <name>pathname</name>
>>        <value>conf/tomcat-users.xml</value>
>>      </parameter>
>>    </ResourceParams>
>>
>>
>><Resource name="jdbc/myoracle" auth="Container" 
>>type="javax.sql.DataSource"/>
>><ResourceParams name="jdbc/myoracle">
>>
>><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>>    <parameter><name>username</name><value>***</value></parameter>
>>    <parameter><name>password</name><value>***</value></parameter>
>>
>><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>>
>><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>>    
>><parameter><name>removeAbandoned</name><value>false</value></parameter>
>>
>><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>>    <parameter><name>logAbandoned</name><value>true</value></parameter>
>>    <parameter><name>maxActive</name><value>10</value></parameter>
>></ResourceParams>
>>
>>
>>  </GlobalNamingResources>
>>
>>  <Service name="Catalina">
>>    <Connector port="8080" />
>>
>>    <!-- This is here for compatibility only, not required -->
>>    <Connector port="8009" protocol="AJP/1.3" />
>>
>>    <Engine name="Catalina" defaultHost="localhost">
>>      <Logger className="org.apache.catalina.logger.FileLogger" />
>>
>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>             resourceName="UserDatabase" />
>>
>>      <Host name="localhost" appBase="webapps" />
>>    </Engine>
>>  </Service>
>></Server>
>>
>>
>>
>>WEB.XML
>>
>><?xml version="1.0" encoding="ISO-8859-1"?>
>>
>><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
>>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>>    version="2.4">
>>
>>  <display-name>Welcome to Tomcat</display-name>
>>  <description>
>>     Welcome to Tomcat
>>  </description>
>>
>><resource-ref>
>><res-ref-name>jdbc/myoracle</res-ref-name>
>><res-type>javax.sql.DataSource</res-type>
>><res-auth>Container</res-auth>
>></resource-ref>
>>
>></web-app>
>>
>>
>>
>>
>>TEST.JSP
>>
>>...
>>Context initContext = new InitialContext();
>>Context envContext  = (Context)initContext.lookup("java:/comp/env");
>>DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>>conn = ds.getConnection();
>>...
>>
>>_________________________________________________________________
>>Descarga gratis la Barra de Herramientas de MSN 
>>http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
>>
>>
>>---------------------------------------------------------------------
>>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
>

_________________________________________________________________
Descubre la descarga digital con MSN Music. Más de medio millón de 
canciones. http://music.msn.es/


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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Parsons Technical Services <pa...@earthlink.net>.
Do you have your resource link in the context element? And if you don't have 
a context for the app you need to create one.

Doug


----- Original Message ----- 
From: "Sevillano sevi llano" <se...@hotmail.com>
To: <to...@jakarta.apache.org>
Sent: Friday, April 15, 2005 5:34 AM
Subject: can´t Configurate Database Connection Pool (DBCP) with Tomcat 
5.0.28


> Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
>
> I´m following this documentation:
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
>
> "...Add this in between the </Context> tag of the examples context and the 
> </Host> tag closing the localhost definition..."
> but there is no </Context> in my server.xml
>
> also I´ver read tons of forums about this question, and I´ve tested a lot 
> of different configuration.
>
> this is the error I´ve got (the usual I think):
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
> class '' for connect URL 'null'
>
>
>
> any help please? I´ve been the whole week trying to fix it
>
> thanks
>
>
>
>
> these are my files:
>
> SERVER.XML
>
> <Server port="8005" shutdown="SHUTDOWN">
>
>
>  <GlobalNamingResources>
>    <!-- Used by Manager webapp -->
>    <Resource name="UserDatabase" auth="Container"
>              type="org.apache.catalina.UserDatabase"
>      description="User database that can be updated and saved">
>    </Resource>
>    <ResourceParams name="UserDatabase">
>      <parameter>
>        <name>factory</name>
>        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>      </parameter>
>      <parameter>
>        <name>pathname</name>
>        <value>conf/tomcat-users.xml</value>
>      </parameter>
>    </ResourceParams>
>
>
> <Resource name="jdbc/myoracle" auth="Container" 
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/myoracle">
> 
> <parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>    <parameter><name>username</name><value>***</value></parameter>
>    <parameter><name>password</name><value>***</value></parameter>
> 
> <parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> 
> <parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>    <parameter><name>removeAbandoned</name><value>false</value></parameter>
> 
> <parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>    <parameter><name>logAbandoned</name><value>true</value></parameter>
>    <parameter><name>maxActive</name><value>10</value></parameter>
> </ResourceParams>
>
>
>  </GlobalNamingResources>
>
>  <Service name="Catalina">
>    <Connector port="8080" />
>
>    <!-- This is here for compatibility only, not required -->
>    <Connector port="8009" protocol="AJP/1.3" />
>
>    <Engine name="Catalina" defaultHost="localhost">
>      <Logger className="org.apache.catalina.logger.FileLogger" />
>
>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>             resourceName="UserDatabase" />
>
>      <Host name="localhost" appBase="webapps" />
>    </Engine>
>  </Service>
> </Server>
>
>
>
> WEB.XML
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>    version="2.4">
>
>  <display-name>Welcome to Tomcat</display-name>
>  <description>
>     Welcome to Tomcat
>  </description>
>
> <resource-ref>
> <res-ref-name>jdbc/myoracle</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> </web-app>
>
>
>
>
> TEST.JSP
>
> ...
> Context initContext = new InitialContext();
> Context envContext  = (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
> conn = ds.getConnection();
> ...
>
> _________________________________________________________________
> Descarga gratis la Barra de Herramientas de MSN 
> http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
>
>
> ---------------------------------------------------------------------
> 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


Re: can�t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Caroline Jen <ji...@yahoo.com>.
I had exactly the same problem when I tried to
configure the Tomcat 5.0.27.  At that time, a number
of people reported "the" difficulty.  Finally, we put
the configuration code in between the <realm .../>
element and the <Host> element of the
$TOMCAT/conf/server.xml.

Please e-mail me if you still have the problem.  I
will give you the step-by-step procedure.
--- Anto Paul <an...@gmail.com> wrote:

> On 4/15/05, Sevillano sevi llano
> <se...@hotmail.com> wrote:
> > I don�t know if it helps, but this is my
> environment:
> > 
> > j2sdk1.4.2_07
> > tomcat 5.0.28
> > oracle 9
> > 
> > j2sdk1.4.2_07
> > tomcat 5.0.28
> > mysql (I don�t remember the version, this is my
> home environment)
> > 
> > thanks
> > 
> > >From: "Sevillano sevi llano"
> <se...@hotmail.com>
> > >Reply-To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> > >To: tomcat-user@jakarta.apache.org
> > >Subject: Re: can�t Configurate Database
> Connection Pool (DBCP) with Tomcat
> > >5.0.28
> > >Date: Fri, 15 Apr 2005 09:48:29 +0000
> > >
> > >I think JDBC Drivers are correctly installed,
> because direct connection
> > >works correctly:
> > >DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
> > >conn =
> >
>
>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
> > >
> > >
> > >I have the .jar files in
> > >Tomcat 5.0\common\lib
> > >
> > >
> > >>From: "Benjamin Cuthbert"
> <be...@db.com>
> > >>Reply-To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> > >>To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> > >>CC: tomcat-user@jakarta.apache.org
> > >>Subject: Re:  can�t Configurate Database
> Connection Pool (DBCP) with
> > >>Tomcat 5.0.28
> > >>Date: Fri, 15 Apr 2005 10:45:01 +0100
> > >>
> > >>And you have the JDBC Driver installed, and
> tomcat comes up with no
> > >>errors.
> > >>
> > >>Are you just trying to setup user authentication
> against a database
> > >>instead of tomcat-users.xml
> > >>
> > >>
> > >>
> > >>Ben Cuthbert
> > >>Deutsche Bank - Global Markets
> > >>TISO Customer Trading Technology
> > >>PGP: http://pgp.mit.edu
> > >>
> > >>+44 (0) 20 754 76389 (Tel)
> > >>+44 (0) 20 754 74996 (Fax)
> > >>
> > >>
> > >>
> > >>
> > >>"Sevillano sevi llano" <se...@hotmail.com>
> > >>04/15/2005 10:41 AM
> > >>Please respond to "Tomcat Users List"
> > >>
> > >>         To:     tomcat-user@jakarta.apache.org
> > >>         cc:
> > >>         Subject:        Re: can�t Configurate
> Database Connection Pool
> > >>(DBCP) with Tomcat 5.0.28
> > >>
> > >>
> > >>Hi Benajmin,
> > >>
> > >>I�m testing with two different databases:
> > >>oracle 9 and mysql
> > >>
> > >>with both I�ve got the same error
> > >>org.apache.commons.dbcp.SQLNestedException:
> Cannot create JDBC driver of
> > >>class '' for connect URL 'null'
> > >>
> > >>and with both I can connect directly
> > >>for example, it works correctly:
> > >>...
> > >>DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
> > >>conn =
> >
>
>>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
> > >>...
> > >>
> > >>
> > >>Thanks very much
> > >>
> > >>
> > >> >From: "Benjamin Cuthbert"
> <be...@db.com>
> > >> >Reply-To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> > >> >To: "Tomcat Users List"
> <to...@jakarta.apache.org>
> > >> >CC: tomcat-user@jakarta.apache.org
> > >> >Subject: Re:  can�t Configurate Database
> Connection Pool (DBCP) with
> > >>Tomcat
> > >> >5.0.28
> > >> >Date: Fri, 15 Apr 2005 10:36:30 +0100
> > >> >
> > >> >Sevillano
> > >> >
> > >> >Can you show me your JDBC configuration.
> > >> >
> > >> >
> > >> >
> > >> >Ben Cuthbert
> > >> >Deutsche Bank - Global Markets
> > >> >TISO Customer Trading Technology
> > >> >PGP: http://pgp.mit.edu
> > >> >
> > >> >+44 (0) 20 754 76389 (Tel)
> > >> >+44 (0) 20 754 74996 (Fax)
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >"Sevillano sevi llano"
> <se...@hotmail.com>
> > >> >04/15/2005 10:34 AM
> > >> >Please respond to "Tomcat Users List"
> > >> >
> > >> >         To:    
> tomcat-user@jakarta.apache.org
> > >> >         cc:
> > >> >         Subject:        can�t Configurate
> Database Connection Pool
> > >>(DBCP)
> > >> >with Tomcat 5.0.28
> > >> >
> > >> >
> > >> >Hi, I�m a newbie trying to configurate DBCP
> with Tomcat 5.0.28
> > >> >
> > >> >I�m following this documentation:
> > >>
>
>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> > >> >
> > >> >
> > >> >"...Add this in between the </Context> tag of
> the examples context and
> > >>the
> > >> >
> > >> ></Host> tag closing the localhost
> definition..."
> > >> >but there is no </Context> in my server.xml
> > >> >
> > >> >also I�ver read tons of forums about this
> question, and I�ve tested a
> > >>lot
> > >> >of
> > >> >different configuration.
> > >> >
> > >> >this is the error I�ve got (the usual I
> think):
> > >> >org.apache.commons.dbcp.SQLNestedException:
> Cannot create JDBC driver of
> > >> >class '' for connect URL 'null'
> > >> >
> > >> >
> > >> >
> > >> >any help please? I�ve been the whole week
> trying to fix it
> > >> >
> > >> >thanks
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >these are my files:
> > >> >
> > >> >SERVER.XML
> > >> >
> > >> ><Server port="8005" shutdown="SHUTDOWN">
> > >> >
> > >> >
> > >> >   <GlobalNamingResources>
> > >> >     <!-- Used by Manager webapp -->
> > >> >     <Resource name="UserDatabase"
> auth="Container"
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Anto Paul <an...@gmail.com>.
On 4/15/05, Sevillano sevi llano <se...@hotmail.com> wrote:
> I don´t know if it helps, but this is my environment:
> 
> j2sdk1.4.2_07
> tomcat 5.0.28
> oracle 9
> 
> j2sdk1.4.2_07
> tomcat 5.0.28
> mysql (I don´t remember the version, this is my home environment)
> 
> thanks
> 
> >From: "Sevillano sevi llano" <se...@hotmail.com>
> >Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
> >To: tomcat-user@jakarta.apache.org
> >Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat
> >5.0.28
> >Date: Fri, 15 Apr 2005 09:48:29 +0000
> >
> >I think JDBC Drivers are correctly installed, because direct connection
> >works correctly:
> >DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> >conn =
> >DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
> >
> >
> >I have the .jar files in
> >Tomcat 5.0\common\lib
> >
> >
> >>From: "Benjamin Cuthbert" <be...@db.com>
> >>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
> >>To: "Tomcat Users List" <to...@jakarta.apache.org>
> >>CC: tomcat-user@jakarta.apache.org
> >>Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with
> >>Tomcat 5.0.28
> >>Date: Fri, 15 Apr 2005 10:45:01 +0100
> >>
> >>And you have the JDBC Driver installed, and tomcat comes up with no
> >>errors.
> >>
> >>Are you just trying to setup user authentication against a database
> >>instead of tomcat-users.xml
> >>
> >>
> >>
> >>Ben Cuthbert
> >>Deutsche Bank - Global Markets
> >>TISO Customer Trading Technology
> >>PGP: http://pgp.mit.edu
> >>
> >>+44 (0) 20 754 76389 (Tel)
> >>+44 (0) 20 754 74996 (Fax)
> >>
> >>
> >>
> >>
> >>"Sevillano sevi llano" <se...@hotmail.com>
> >>04/15/2005 10:41 AM
> >>Please respond to "Tomcat Users List"
> >>
> >>         To:     tomcat-user@jakarta.apache.org
> >>         cc:
> >>         Subject:        Re: can´t Configurate Database Connection Pool
> >>(DBCP) with Tomcat 5.0.28
> >>
> >>
> >>Hi Benajmin,
> >>
> >>I´m testing with two different databases:
> >>oracle 9 and mysql
> >>
> >>with both I´ve got the same error
> >>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> >>class '' for connect URL 'null'
> >>
> >>and with both I can connect directly
> >>for example, it works correctly:
> >>...
> >>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> >>conn =
> >>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
> >>...
> >>
> >>
> >>Thanks very much
> >>
> >>
> >> >From: "Benjamin Cuthbert" <be...@db.com>
> >> >Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
> >> >To: "Tomcat Users List" <to...@jakarta.apache.org>
> >> >CC: tomcat-user@jakarta.apache.org
> >> >Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with
> >>Tomcat
> >> >5.0.28
> >> >Date: Fri, 15 Apr 2005 10:36:30 +0100
> >> >
> >> >Sevillano
> >> >
> >> >Can you show me your JDBC configuration.
> >> >
> >> >
> >> >
> >> >Ben Cuthbert
> >> >Deutsche Bank - Global Markets
> >> >TISO Customer Trading Technology
> >> >PGP: http://pgp.mit.edu
> >> >
> >> >+44 (0) 20 754 76389 (Tel)
> >> >+44 (0) 20 754 74996 (Fax)
> >> >
> >> >
> >> >
> >> >
> >> >"Sevillano sevi llano" <se...@hotmail.com>
> >> >04/15/2005 10:34 AM
> >> >Please respond to "Tomcat Users List"
> >> >
> >> >         To:     tomcat-user@jakarta.apache.org
> >> >         cc:
> >> >         Subject:        can´t Configurate Database Connection Pool
> >>(DBCP)
> >> >with Tomcat 5.0.28
> >> >
> >> >
> >> >Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
> >> >
> >> >I´m following this documentation:
> >> >http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> >> >
> >> >
> >> >"...Add this in between the </Context> tag of the examples context and
> >>the
> >> >
> >> ></Host> tag closing the localhost definition..."
> >> >but there is no </Context> in my server.xml
> >> >
> >> >also I´ver read tons of forums about this question, and I´ve tested a
> >>lot
> >> >of
> >> >different configuration.
> >> >
> >> >this is the error I´ve got (the usual I think):
> >> >org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> >> >class '' for connect URL 'null'
> >> >
> >> >
> >> >
> >> >any help please? I´ve been the whole week trying to fix it
> >> >
> >> >thanks
> >> >
> >> >
> >> >
> >> >
> >> >these are my files:
> >> >
> >> >SERVER.XML
> >> >
> >> ><Server port="8005" shutdown="SHUTDOWN">
> >> >
> >> >
> >> >   <GlobalNamingResources>
> >> >     <!-- Used by Manager webapp -->
> >> >     <Resource name="UserDatabase" auth="Container"
> >> >               type="org.apache.catalina.UserDatabase"
> >> >       description="User database that can be updated and saved">
> >> >     </Resource>
> >> >     <ResourceParams name="UserDatabase">
> >> >       <parameter>
> >> >         <name>factory</name>
> >> > <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >> >       </parameter>
> >> >       <parameter>
> >> >         <name>pathname</name>
> >> >         <value>conf/tomcat-users.xml</value>
> >> >       </parameter>
> >> >     </ResourceParams>
> >> >
> >> >
> >> >                  <Resource name="jdbc/myoracle" auth="Container"
> >> >type="javax.sql.DataSource"/>
> >> >                  <ResourceParams name="jdbc/myoracle">
> >> >
> >> ><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
> >> >  <parameter><name>username</name><value>***</value></parameter>
> >> >  <parameter><name>password</name><value>***</value></parameter>
> >> >
> >> ><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> >> >
> >> ><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
> >> >
> >><parameter><name>removeAbandoned</name><value>false</value></parameter>
> >> >
> >> ><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
> >> >  <parameter><name>logAbandoned</name><value>true</value></parameter>
> >> >  <parameter><name>maxActive</name><value>10</value></parameter>
> >> >                  </ResourceParams>
> >> >
> >> >
> >> >   </GlobalNamingResources>
> >> >
> >> >   <Service name="Catalina">
> >> >     <Connector port="8080" />
> >> >
> >> >     <!-- This is here for compatibility only, not required -->
> >> >     <Connector port="8009" protocol="AJP/1.3" />
> >> >
> >> >     <Engine name="Catalina" defaultHost="localhost">
> >> >       <Logger className="org.apache.catalina.logger.FileLogger" />
> >> >
> >> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >> >              resourceName="UserDatabase" />
> >> >
> >> >       <Host name="localhost" appBase="webapps" />
> >> >     </Engine>
> >> >   </Service>
> >> ></Server>
> >> >
> >> >
> >> >
> >> >WEB.XML
> >> >
> >> ><?xml version="1.0" encoding="ISO-8859-1"?>
> >> >
> >> ><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> >> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> >> >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> >> >     version="2.4">
> >> >
> >> >   <display-name>Welcome to Tomcat</display-name>
> >> >   <description>
> >> >      Welcome to Tomcat
> >> >   </description>
> >> >
> >> >                  <resource-ref>
> >> >  <res-ref-name>jdbc/myoracle</res-ref-name>
> >> > <res-type>javax.sql.DataSource</res-type>
> >> >                                  <res-auth>Container</res-auth>
> >> >                  </resource-ref>
> >> >
> >> ></web-app>
> >> >
> >> >
> >> >
> >> >
> >> >TEST.JSP
> >> >
> >> >...
> >> >Context initContext = new InitialContext();
> >> >Context envContext  = (Context)initContext.lookup("java:/comp/env");
> >> >DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
> >> >conn = ds.getConnection();
> >> >...
> >> >
> >> >_________________________________________________________________
> >> >Descarga gratis la Barra de Herramientas de MSN
> >> >http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
> >> >
> >> >
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >> >
> >> >
> >> >
> >>
> >>_________________________________________________________________
> >>Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN
> >>Amor
> >>& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >_________________________________________________________________
> >Acepta el reto MSN Premium: Protección para tus hijos en internet.
> >Descárgalo y pruébalo 2 meses gratis.
> >http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> 
> _________________________________________________________________
> Descubre la descarga digital con MSN Music. Más de medio millón de
> canciones. http://music.msn.es/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

If it is not yet solved try removing <resource-ref> from web.xml.
Another option is not to use <GlobalNamingResources> instead follow
the instructions exactly given in the URL you have posted. BTW I
couldnt find any <context> configured in your server.xml. May be it is
the reason.

-- 
Anto Paul

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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Sevillano sevi llano <se...@hotmail.com>.
I don´t know if it helps, but this is my environment:

j2sdk1.4.2_07
tomcat 5.0.28
oracle 9


j2sdk1.4.2_07
tomcat 5.0.28
mysql (I don´t remember the version, this is my home environment)

thanks


>From: "Sevillano sevi llano" <se...@hotmail.com>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: tomcat-user@jakarta.apache.org
>Subject: Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 09:48:29 +0000
>
>I think JDBC Drivers are correctly installed, because direct connection 
>works correctly:
>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>conn =
>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
>
>
>I have the .jar files in
>Tomcat 5.0\common\lib
>
>
>>From: "Benjamin Cuthbert" <be...@db.com>
>>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>>To: "Tomcat Users List" <to...@jakarta.apache.org>
>>CC: tomcat-user@jakarta.apache.org
>>Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with 
>>Tomcat 5.0.28
>>Date: Fri, 15 Apr 2005 10:45:01 +0100
>>
>>And you have the JDBC Driver installed, and tomcat comes up with no
>>errors.
>>
>>Are you just trying to setup user authentication against a database
>>instead of tomcat-users.xml
>>
>>
>>
>>Ben Cuthbert
>>Deutsche Bank - Global Markets
>>TISO Customer Trading Technology
>>PGP: http://pgp.mit.edu
>>
>>+44 (0) 20 754 76389 (Tel)
>>+44 (0) 20 754 74996 (Fax)
>>
>>
>>
>>
>>"Sevillano sevi llano" <se...@hotmail.com>
>>04/15/2005 10:41 AM
>>Please respond to "Tomcat Users List"
>>
>>         To:     tomcat-user@jakarta.apache.org
>>         cc:
>>         Subject:        Re: can´t Configurate Database Connection Pool
>>(DBCP) with Tomcat 5.0.28
>>
>>
>>Hi Benajmin,
>>
>>I´m testing with two different databases:
>>oracle 9 and mysql
>>
>>with both I´ve got the same error
>>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>>class '' for connect URL 'null'
>>
>>and with both I can connect directly
>>for example, it works correctly:
>>...
>>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>>conn =
>>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
>>...
>>
>>
>>Thanks very much
>>
>>
>> >From: "Benjamin Cuthbert" <be...@db.com>
>> >Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>> >To: "Tomcat Users List" <to...@jakarta.apache.org>
>> >CC: tomcat-user@jakarta.apache.org
>> >Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with
>>Tomcat
>> >5.0.28
>> >Date: Fri, 15 Apr 2005 10:36:30 +0100
>> >
>> >Sevillano
>> >
>> >Can you show me your JDBC configuration.
>> >
>> >
>> >
>> >Ben Cuthbert
>> >Deutsche Bank - Global Markets
>> >TISO Customer Trading Technology
>> >PGP: http://pgp.mit.edu
>> >
>> >+44 (0) 20 754 76389 (Tel)
>> >+44 (0) 20 754 74996 (Fax)
>> >
>> >
>> >
>> >
>> >"Sevillano sevi llano" <se...@hotmail.com>
>> >04/15/2005 10:34 AM
>> >Please respond to "Tomcat Users List"
>> >
>> >         To:     tomcat-user@jakarta.apache.org
>> >         cc:
>> >         Subject:        can´t Configurate Database Connection Pool
>>(DBCP)
>> >with Tomcat 5.0.28
>> >
>> >
>> >Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
>> >
>> >I´m following this documentation:
>> >http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
>> >
>> >
>> >"...Add this in between the </Context> tag of the examples context and
>>the
>> >
>> ></Host> tag closing the localhost definition..."
>> >but there is no </Context> in my server.xml
>> >
>> >also I´ver read tons of forums about this question, and I´ve tested a 
>>lot
>> >of
>> >different configuration.
>> >
>> >this is the error I´ve got (the usual I think):
>> >org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>> >class '' for connect URL 'null'
>> >
>> >
>> >
>> >any help please? I´ve been the whole week trying to fix it
>> >
>> >thanks
>> >
>> >
>> >
>> >
>> >these are my files:
>> >
>> >SERVER.XML
>> >
>> ><Server port="8005" shutdown="SHUTDOWN">
>> >
>> >
>> >   <GlobalNamingResources>
>> >     <!-- Used by Manager webapp -->
>> >     <Resource name="UserDatabase" auth="Container"
>> >               type="org.apache.catalina.UserDatabase"
>> >       description="User database that can be updated and saved">
>> >     </Resource>
>> >     <ResourceParams name="UserDatabase">
>> >       <parameter>
>> >         <name>factory</name>
>> > <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>> >       </parameter>
>> >       <parameter>
>> >         <name>pathname</name>
>> >         <value>conf/tomcat-users.xml</value>
>> >       </parameter>
>> >     </ResourceParams>
>> >
>> >
>> >                  <Resource name="jdbc/myoracle" auth="Container"
>> >type="javax.sql.DataSource"/>
>> >                  <ResourceParams name="jdbc/myoracle">
>> >
>> ><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>> >  <parameter><name>username</name><value>***</value></parameter>
>> >  <parameter><name>password</name><value>***</value></parameter>
>> >
>> ><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>> >
>> ><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>> >  
>><parameter><name>removeAbandoned</name><value>false</value></parameter>
>> >
>> ><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>> >  <parameter><name>logAbandoned</name><value>true</value></parameter>
>> >  <parameter><name>maxActive</name><value>10</value></parameter>
>> >                  </ResourceParams>
>> >
>> >
>> >   </GlobalNamingResources>
>> >
>> >   <Service name="Catalina">
>> >     <Connector port="8080" />
>> >
>> >     <!-- This is here for compatibility only, not required -->
>> >     <Connector port="8009" protocol="AJP/1.3" />
>> >
>> >     <Engine name="Catalina" defaultHost="localhost">
>> >       <Logger className="org.apache.catalina.logger.FileLogger" />
>> >
>> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>> >              resourceName="UserDatabase" />
>> >
>> >       <Host name="localhost" appBase="webapps" />
>> >     </Engine>
>> >   </Service>
>> ></Server>
>> >
>> >
>> >
>> >WEB.XML
>> >
>> ><?xml version="1.0" encoding="ISO-8859-1"?>
>> >
>> ><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>> >     version="2.4">
>> >
>> >   <display-name>Welcome to Tomcat</display-name>
>> >   <description>
>> >      Welcome to Tomcat
>> >   </description>
>> >
>> >                  <resource-ref>
>> >  <res-ref-name>jdbc/myoracle</res-ref-name>
>> > <res-type>javax.sql.DataSource</res-type>
>> >                                  <res-auth>Container</res-auth>
>> >                  </resource-ref>
>> >
>> ></web-app>
>> >
>> >
>> >
>> >
>> >TEST.JSP
>> >
>> >...
>> >Context initContext = new InitialContext();
>> >Context envContext  = (Context)initContext.lookup("java:/comp/env");
>> >DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>> >conn = ds.getConnection();
>> >...
>> >
>> >_________________________________________________________________
>> >Descarga gratis la Barra de Herramientas de MSN
>> >http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
>> >
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >
>> >
>> >
>>
>>_________________________________________________________________
>>Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN
>>Amor
>>& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>
>_________________________________________________________________
>Acepta el reto MSN Premium: Protección para tus hijos en internet. 
>Descárgalo y pruébalo 2 meses gratis. 
>http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>

_________________________________________________________________
Descubre la descarga digital con MSN Music. Más de medio millón de 
canciones. http://music.msn.es/


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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Sevillano sevi llano <se...@hotmail.com>.
I think JDBC Drivers are correctly installed, because direct connection 
works correctly:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn =
DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");


I have the .jar files in
Tomcat 5.0\common\lib


>From: "Benjamin Cuthbert" <be...@db.com>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>CC: tomcat-user@jakarta.apache.org
>Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 10:45:01 +0100
>
>And you have the JDBC Driver installed, and tomcat comes up with no
>errors.
>
>Are you just trying to setup user authentication against a database
>instead of tomcat-users.xml
>
>
>
>Ben Cuthbert
>Deutsche Bank - Global Markets
>TISO Customer Trading Technology
>PGP: http://pgp.mit.edu
>
>+44 (0) 20 754 76389 (Tel)
>+44 (0) 20 754 74996 (Fax)
>
>
>
>
>"Sevillano sevi llano" <se...@hotmail.com>
>04/15/2005 10:41 AM
>Please respond to "Tomcat Users List"
>
>         To:     tomcat-user@jakarta.apache.org
>         cc:
>         Subject:        Re: can´t Configurate Database Connection Pool
>(DBCP) with Tomcat 5.0.28
>
>
>Hi Benajmin,
>
>I´m testing with two different databases:
>oracle 9 and mysql
>
>with both I´ve got the same error
>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>class '' for connect URL 'null'
>
>and with both I can connect directly
>for example, it works correctly:
>...
>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>conn =
>DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
>...
>
>
>Thanks very much
>
>
> >From: "Benjamin Cuthbert" <be...@db.com>
> >Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
> >To: "Tomcat Users List" <to...@jakarta.apache.org>
> >CC: tomcat-user@jakarta.apache.org
> >Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with
>Tomcat
> >5.0.28
> >Date: Fri, 15 Apr 2005 10:36:30 +0100
> >
> >Sevillano
> >
> >Can you show me your JDBC configuration.
> >
> >
> >
> >Ben Cuthbert
> >Deutsche Bank - Global Markets
> >TISO Customer Trading Technology
> >PGP: http://pgp.mit.edu
> >
> >+44 (0) 20 754 76389 (Tel)
> >+44 (0) 20 754 74996 (Fax)
> >
> >
> >
> >
> >"Sevillano sevi llano" <se...@hotmail.com>
> >04/15/2005 10:34 AM
> >Please respond to "Tomcat Users List"
> >
> >         To:     tomcat-user@jakarta.apache.org
> >         cc:
> >         Subject:        can´t Configurate Database Connection Pool
>(DBCP)
> >with Tomcat 5.0.28
> >
> >
> >Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
> >
> >I´m following this documentation:
> >http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> >
> >
> >"...Add this in between the </Context> tag of the examples context and
>the
> >
> ></Host> tag closing the localhost definition..."
> >but there is no </Context> in my server.xml
> >
> >also I´ver read tons of forums about this question, and I´ve tested a lot
> >of
> >different configuration.
> >
> >this is the error I´ve got (the usual I think):
> >org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> >class '' for connect URL 'null'
> >
> >
> >
> >any help please? I´ve been the whole week trying to fix it
> >
> >thanks
> >
> >
> >
> >
> >these are my files:
> >
> >SERVER.XML
> >
> ><Server port="8005" shutdown="SHUTDOWN">
> >
> >
> >   <GlobalNamingResources>
> >     <!-- Used by Manager webapp -->
> >     <Resource name="UserDatabase" auth="Container"
> >               type="org.apache.catalina.UserDatabase"
> >       description="User database that can be updated and saved">
> >     </Resource>
> >     <ResourceParams name="UserDatabase">
> >       <parameter>
> >         <name>factory</name>
> > <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >       </parameter>
> >       <parameter>
> >         <name>pathname</name>
> >         <value>conf/tomcat-users.xml</value>
> >       </parameter>
> >     </ResourceParams>
> >
> >
> >                  <Resource name="jdbc/myoracle" auth="Container"
> >type="javax.sql.DataSource"/>
> >                  <ResourceParams name="jdbc/myoracle">
> >
> ><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
> >  <parameter><name>username</name><value>***</value></parameter>
> >  <parameter><name>password</name><value>***</value></parameter>
> >
> ><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
> >
> ><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
> >  <parameter><name>removeAbandoned</name><value>false</value></parameter>
> >
> ><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
> >  <parameter><name>logAbandoned</name><value>true</value></parameter>
> >  <parameter><name>maxActive</name><value>10</value></parameter>
> >                  </ResourceParams>
> >
> >
> >   </GlobalNamingResources>
> >
> >   <Service name="Catalina">
> >     <Connector port="8080" />
> >
> >     <!-- This is here for compatibility only, not required -->
> >     <Connector port="8009" protocol="AJP/1.3" />
> >
> >     <Engine name="Catalina" defaultHost="localhost">
> >       <Logger className="org.apache.catalina.logger.FileLogger" />
> >
> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >              resourceName="UserDatabase" />
> >
> >       <Host name="localhost" appBase="webapps" />
> >     </Engine>
> >   </Service>
> ></Server>
> >
> >
> >
> >WEB.XML
> >
> ><?xml version="1.0" encoding="ISO-8859-1"?>
> >
> ><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> >     version="2.4">
> >
> >   <display-name>Welcome to Tomcat</display-name>
> >   <description>
> >      Welcome to Tomcat
> >   </description>
> >
> >                  <resource-ref>
> >  <res-ref-name>jdbc/myoracle</res-ref-name>
> > <res-type>javax.sql.DataSource</res-type>
> >                                  <res-auth>Container</res-auth>
> >                  </resource-ref>
> >
> ></web-app>
> >
> >
> >
> >
> >TEST.JSP
> >
> >...
> >Context initContext = new InitialContext();
> >Context envContext  = (Context)initContext.lookup("java:/comp/env");
> >DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
> >conn = ds.getConnection();
> >...
> >
> >_________________________________________________________________
> >Descarga gratis la Barra de Herramientas de MSN
> >http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >
>
>_________________________________________________________________
>Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN
>Amor
>& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>

_________________________________________________________________
Acepta el reto MSN Premium: Protección para tus hijos en internet. 
Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil


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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Benjamin Cuthbert <be...@db.com>.
And you have the JDBC Driver installed, and tomcat comes up with no 
errors.

Are you just trying to setup user authentication against a database 
instead of tomcat-users.xml



Ben Cuthbert
Deutsche Bank - Global Markets
TISO Customer Trading Technology
PGP: http://pgp.mit.edu

+44 (0) 20 754 76389 (Tel)
+44 (0) 20 754 74996 (Fax)




"Sevillano sevi llano" <se...@hotmail.com>
04/15/2005 10:41 AM
Please respond to "Tomcat Users List"
 
        To:     tomcat-user@jakarta.apache.org
        cc: 
        Subject:        Re: can´t Configurate Database Connection Pool 
(DBCP) with Tomcat 5.0.28


Hi Benajmin,

I´m testing with two different databases:
oracle 9 and mysql

with both I´ve got the same error
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'

and with both I can connect directly
for example, it works correctly:
...
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = 
DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
...


Thanks very much


>From: "Benjamin Cuthbert" <be...@db.com>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>CC: tomcat-user@jakarta.apache.org
>Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with 
Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 10:36:30 +0100
>
>Sevillano
>
>Can you show me your JDBC configuration.
>
>
>
>Ben Cuthbert
>Deutsche Bank - Global Markets
>TISO Customer Trading Technology
>PGP: http://pgp.mit.edu
>
>+44 (0) 20 754 76389 (Tel)
>+44 (0) 20 754 74996 (Fax)
>
>
>
>
>"Sevillano sevi llano" <se...@hotmail.com>
>04/15/2005 10:34 AM
>Please respond to "Tomcat Users List"
>
>         To:     tomcat-user@jakarta.apache.org
>         cc:
>         Subject:        can´t Configurate Database Connection Pool 
(DBCP)
>with Tomcat 5.0.28
>
>
>Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
>
>I´m following this documentation:
>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
>
>
>"...Add this in between the </Context> tag of the examples context and 
the
>
></Host> tag closing the localhost definition..."
>but there is no </Context> in my server.xml
>
>also I´ver read tons of forums about this question, and I´ve tested a lot
>of
>different configuration.
>
>this is the error I´ve got (the usual I think):
>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>class '' for connect URL 'null'
>
>
>
>any help please? I´ve been the whole week trying to fix it
>
>thanks
>
>
>
>
>these are my files:
>
>SERVER.XML
>
><Server port="8005" shutdown="SHUTDOWN">
>
>
>   <GlobalNamingResources>
>     <!-- Used by Manager webapp -->
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>       description="User database that can be updated and saved">
>     </Resource>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
> <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
>
>
>                  <Resource name="jdbc/myoracle" auth="Container"
>type="javax.sql.DataSource"/>
>                  <ResourceParams name="jdbc/myoracle">
>
><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>  <parameter><name>username</name><value>***</value></parameter>
>  <parameter><name>password</name><value>***</value></parameter>
>
><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>
><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>  <parameter><name>removeAbandoned</name><value>false</value></parameter>
>
><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>  <parameter><name>logAbandoned</name><value>true</value></parameter>
>  <parameter><name>maxActive</name><value>10</value></parameter>
>                  </ResourceParams>
>
>
>   </GlobalNamingResources>
>
>   <Service name="Catalina">
>     <Connector port="8080" />
>
>     <!-- This is here for compatibility only, not required -->
>     <Connector port="8009" protocol="AJP/1.3" />
>
>     <Engine name="Catalina" defaultHost="localhost">
>       <Logger className="org.apache.catalina.logger.FileLogger" />
>
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase" />
>
>       <Host name="localhost" appBase="webapps" />
>     </Engine>
>   </Service>
></Server>
>
>
>
>WEB.XML
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>     version="2.4">
>
>   <display-name>Welcome to Tomcat</display-name>
>   <description>
>      Welcome to Tomcat
>   </description>
>
>                  <resource-ref>
>  <res-ref-name>jdbc/myoracle</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
>                                  <res-auth>Container</res-auth>
>                  </resource-ref>
>
></web-app>
>
>
>
>
>TEST.JSP
>
>...
>Context initContext = new InitialContext();
>Context envContext  = (Context)initContext.lookup("java:/comp/env");
>DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>conn = ds.getConnection();
>...
>
>_________________________________________________________________
>Descarga gratis la Barra de Herramientas de MSN
>http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN 
Amor 
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349


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




Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Sevillano sevi llano <se...@hotmail.com>.
Hi Benajmin,

I´m testing with two different databases:
oracle 9 and mysql

with both I´ve got the same error
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'

and with both I can connect directly
for example, it works correctly:
...
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = 
DriverManager.getConnection("jdbc:oracle:thin:@*.*.*.*:1521:bddesa","**","**");
...


Thanks very much


>From: "Benjamin Cuthbert" <be...@db.com>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>CC: tomcat-user@jakarta.apache.org
>Subject: Re:  can´t Configurate Database Connection Pool (DBCP) with Tomcat 
>5.0.28
>Date: Fri, 15 Apr 2005 10:36:30 +0100
>
>Sevillano
>
>Can you show me your JDBC configuration.
>
>
>
>Ben Cuthbert
>Deutsche Bank - Global Markets
>TISO Customer Trading Technology
>PGP: http://pgp.mit.edu
>
>+44 (0) 20 754 76389 (Tel)
>+44 (0) 20 754 74996 (Fax)
>
>
>
>
>"Sevillano sevi llano" <se...@hotmail.com>
>04/15/2005 10:34 AM
>Please respond to "Tomcat Users List"
>
>         To:     tomcat-user@jakarta.apache.org
>         cc:
>         Subject:        can´t Configurate Database Connection Pool (DBCP)
>with Tomcat 5.0.28
>
>
>Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28
>
>I´m following this documentation:
>http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
>
>
>"...Add this in between the </Context> tag of the examples context and the
>
></Host> tag closing the localhost definition..."
>but there is no </Context> in my server.xml
>
>also I´ver read tons of forums about this question, and I´ve tested a lot
>of
>different configuration.
>
>this is the error I´ve got (the usual I think):
>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
>class '' for connect URL 'null'
>
>
>
>any help please? I´ve been the whole week trying to fix it
>
>thanks
>
>
>
>
>these are my files:
>
>SERVER.XML
>
><Server port="8005" shutdown="SHUTDOWN">
>
>
>   <GlobalNamingResources>
>     <!-- Used by Manager webapp -->
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>       description="User database that can be updated and saved">
>     </Resource>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
>         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
>
>
>                  <Resource name="jdbc/myoracle" auth="Container"
>type="javax.sql.DataSource"/>
>                  <ResourceParams name="jdbc/myoracle">
>
><parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>  <parameter><name>username</name><value>***</value></parameter>
>  <parameter><name>password</name><value>***</value></parameter>
>
><parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>
><parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
>  <parameter><name>removeAbandoned</name><value>false</value></parameter>
>
><parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
>  <parameter><name>logAbandoned</name><value>true</value></parameter>
>  <parameter><name>maxActive</name><value>10</value></parameter>
>                  </ResourceParams>
>
>
>   </GlobalNamingResources>
>
>   <Service name="Catalina">
>     <Connector port="8080" />
>
>     <!-- This is here for compatibility only, not required -->
>     <Connector port="8009" protocol="AJP/1.3" />
>
>     <Engine name="Catalina" defaultHost="localhost">
>       <Logger className="org.apache.catalina.logger.FileLogger" />
>
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase" />
>
>       <Host name="localhost" appBase="webapps" />
>     </Engine>
>   </Service>
></Server>
>
>
>
>WEB.XML
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>     version="2.4">
>
>   <display-name>Welcome to Tomcat</display-name>
>   <description>
>      Welcome to Tomcat
>   </description>
>
>                  <resource-ref>
>  <res-ref-name>jdbc/myoracle</res-ref-name>
>                                  <res-type>javax.sql.DataSource</res-type>
>                                  <res-auth>Container</res-auth>
>                  </resource-ref>
>
></web-app>
>
>
>
>
>TEST.JSP
>
>...
>Context initContext = new InitialContext();
>Context envContext  = (Context)initContext.lookup("java:/comp/env");
>DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>conn = ds.getConnection();
>...
>
>_________________________________________________________________
>Descarga gratis la Barra de Herramientas de MSN
>http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor 
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349


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


Re: can´t Configurate Database Connection Pool (DBCP) with Tomcat 5.0.28

Posted by Benjamin Cuthbert <be...@db.com>.
Sevillano

Can you show me your JDBC configuration.



Ben Cuthbert
Deutsche Bank - Global Markets
TISO Customer Trading Technology
PGP: http://pgp.mit.edu

+44 (0) 20 754 76389 (Tel)
+44 (0) 20 754 74996 (Fax)




"Sevillano sevi llano" <se...@hotmail.com>
04/15/2005 10:34 AM
Please respond to "Tomcat Users List"
 
        To:     tomcat-user@jakarta.apache.org
        cc: 
        Subject:        can´t Configurate Database Connection Pool (DBCP) 
with Tomcat 5.0.28


Hi, I´m a newbie trying to configurate DBCP with Tomcat 5.0.28

I´m following this documentation:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html


"...Add this in between the </Context> tag of the examples context and the 

</Host> tag closing the localhost definition..."
but there is no </Context> in my server.xml

also I´ver read tons of forums about this question, and I´ve tested a lot 
of 
different configuration.

this is the error I´ve got (the usual I think):
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'



any help please? I´ve been the whole week trying to fix it

thanks




these are my files:

SERVER.XML

<Server port="8005" shutdown="SHUTDOWN">


  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
      description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>


                 <Resource name="jdbc/myoracle" auth="Container" 
type="javax.sql.DataSource"/>
                 <ResourceParams name="jdbc/myoracle">
 
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
 <parameter><name>username</name><value>***</value></parameter>
 <parameter><name>password</name><value>***</value></parameter>
 
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
 
<parameter><name>url</name><value>jdbc:oracle:thin:@****:1521:bddesa</value></parameter>
 <parameter><name>removeAbandoned</name><value>false</value></parameter>
 
<parameter><name>removeAbandonedTimeout</name><value>300</value></parameter>
 <parameter><name>logAbandoned</name><value>true</value></parameter>
 <parameter><name>maxActive</name><value>10</value></parameter>
                 </ResourceParams>


  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />

      <Host name="localhost" appBase="webapps" />
    </Engine>
  </Service>
</Server>



WEB.XML

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Tomcat
  </description>

                 <resource-ref>
 <res-ref-name>jdbc/myoracle</res-ref-name>
                                 <res-type>javax.sql.DataSource</res-type>
                                 <res-auth>Container</res-auth>
                 </resource-ref>

</web-app>




TEST.JSP

...
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
conn = ds.getConnection();
...

_________________________________________________________________
Descarga gratis la Barra de Herramientas de MSN 
http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH



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