You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohammed Zabin <jo...@gmail.com> on 2007/05/24 12:02:48 UTC

DBCP

*Hi All*
**
*I want to use DBCP to connect my localhost Oracle Database, I have write
the following in servlet.xml file:*

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

    <ResourceParams name="jdbc/myoracledb">
       <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
       </parameter>
       <parameter>
          <name>driverClassName</name>
          <value>oracle.jdbc.OracleDriver</value>
       </parameter>
       <parameter>
          <name>url</name>
          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
       </parameter>
       <parameter>
          <name>username</name>
          <value>hr</value>
       </parameter>
       <parameter>
          <name>password</name>
          <value>hr</value>
       </parameter>
       <parameter>
          <name>maxActive</name>
          <value>20</value>
       </parameter>
       <parameter>
          <name>maxIdle</name>
          <value>10</value>
       </parameter>
       <parameter>
          <name>maxWait</name>
          <value>-1</value>
       </parameter>
    </ResourceParams>
  </GlobalNamingResources>

*and the following in web.xml file:*

<resource-ref>
   <description>Oracle Datasource example</description>
   <res-ref-name>jdbc/myoracledb</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
</resource-ref>

*and following is my JSP code:*


<%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>

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

  out.println( "Connection Established" );
%>

*When running the above jsp page, i got the following exception:*

*org.apache.jasper.JasperException: javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

Any Help Please, I am working to solving this problem from one week, I
am lost, what is the reason for this exception, any help will be
apprecieated

Jotnarta

Re: DBCP

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pid,

Pid wrote:
> Mohammed Zabin wrote:
>> java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSourceFactory
>>
>> [snip]
>>
>> is there any jar file that should be in lib???
> 
> Yes, I think someone already pointed out that you'll need an Oracle JDBC
> driver.

Though nobody posted this specifically on this thread, any search of the
archives for "ClassNotFoundException connection pool" should have come
up with the same response... over and over and over and over...

I'm sorry, Mohammed, but the archives are there for a reason. It's very
unlikely that nobody but you has ever experienced a particular error.
It's worth searching the archives (or just STFW) before asking a
question like this. You would have had your question answered yesterday
instead of having to wait, and we wouldn't have had to drag the
information out of you. :(

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVteQ9CaO5/Lv0PARAlcpAJ91GY8pbLGCrlPoIud0nsguZxwylwCcDeDH
2XOrJZ17lD+Gube3z0VZkBk=
=M5Nj
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: DBCP

Posted by Pid <p...@pidster.com>.
Mohammed Zabin wrote:
> It didn't work, I put the following in Context.xml:
> <Resource name="jdbc/mydb"
>         auth="Container"
>         type="oracle.jdbc.pool.OracleDataSource"
>         factory="oracle.jdbc.pool.OracleDataSourceFactory"
>         user="hr"
>         password="hr"
>         driverClassName="oracle.jdbc.driver.OracleDriver"
>         url="jdbc:oracle:thin:@localhost:1521:orcldb"
>         maxActive="20" maxIdle="10" maxwait="-1"/>
> and i got the following exception:
> 
> 
> javax.servlet.ServletException: javax.naming.NamingException: Could
> not load resource factory class [Root exception is
> java.lang.ClassNotFoundException:
> oracle.jdbc.pool.OracleDataSourceFactory]
>     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) 
> 
>     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) 
> 
>     org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:75)
>     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) 
> 
>     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) 
> 
>     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 
> is there any jar file that should be in lib???

Yes, I think someone already pointed out that you'll need an Oracle JDBC 
driver.

p


> On 5/24/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Mohammed,
>>
>> Mohammed Zabin wrote:
>> > You know what? I am confusing with this. Shall i put the following code
>> in
>> > web.xml in my web application or web.xml on config folder, shall i use
>> > server.xml or context.xml
>>
>> Use META-INF/context.xml in your WAR file or deployment directory. Don't
>> use ${TOMCAT_HOME}/conf/Catalina/[host]/[app].xml unless there's a
>> really good reason to do so.
>>
>> Put your <Resource> in context.xml and remove all <Resource>
>> configuration from server.xml.
>>
>> Remove any <resource-ref> you have in your web.xml.
>>
>> - -chris
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.7 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFGVZCk9CaO5/Lv0PARAvY4AJ9LdP/csNjVWn3ZU9OVzv527gyWygCfTJmS
>> 3EScAagRpgYlErF8uPLvF9E=
>> =MAx6
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


Re: DBCP

Posted by Mohammed Zabin <jo...@gmail.com>.
It didn't work, I put the following in Context.xml:
<Resource name="jdbc/mydb"
         auth="Container"
         type="oracle.jdbc.pool.OracleDataSource"
         factory="oracle.jdbc.pool.OracleDataSourceFactory"
         user="hr"
         password="hr"
         driverClassName="oracle.jdbc.driver.OracleDriver"
         url="jdbc:oracle:thin:@localhost:1521:orcldb"
         maxActive="20" maxIdle="10" maxwait="-1"/>
and i got the following exception:


javax.servlet.ServletException: javax.naming.NamingException: Could
not load resource factory class [Root exception is
java.lang.ClassNotFoundException:
oracle.jdbc.pool.OracleDataSourceFactory]
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
	org.apache.jsp.jsp.testDBCP_jsp._jspService(testDBCP_jsp.java:75)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

is there any jar file that should be in lib???


On 5/24/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mohammed,
>
> Mohammed Zabin wrote:
> > You know what? I am confusing with this. Shall i put the following code
> in
> > web.xml in my web application or web.xml on config folder, shall i use
> > server.xml or context.xml
>
> Use META-INF/context.xml in your WAR file or deployment directory. Don't
> use ${TOMCAT_HOME}/conf/Catalina/[host]/[app].xml unless there's a
> really good reason to do so.
>
> Put your <Resource> in context.xml and remove all <Resource>
> configuration from server.xml.
>
> Remove any <resource-ref> you have in your web.xml.
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGVZCk9CaO5/Lv0PARAvY4AJ9LdP/csNjVWn3ZU9OVzv527gyWygCfTJmS
> 3EScAagRpgYlErF8uPLvF9E=
> =MAx6
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: DBCP

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mohammed,

Mohammed Zabin wrote:
> You know what? I am confusing with this. Shall i put the following code in
> web.xml in my web application or web.xml on config folder, shall i use
> server.xml or context.xml

Use META-INF/context.xml in your WAR file or deployment directory. Don't
use ${TOMCAT_HOME}/conf/Catalina/[host]/[app].xml unless there's a
really good reason to do so.

Put your <Resource> in context.xml and remove all <Resource>
configuration from server.xml.

Remove any <resource-ref> you have in your web.xml.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVZCk9CaO5/Lv0PARAvY4AJ9LdP/csNjVWn3ZU9OVzv527gyWygCfTJmS
3EScAagRpgYlErF8uPLvF9E=
=MAx6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: DBCP

Posted by Mohammed Zabin <jo...@gmail.com>.
You know what? I am confusing with this. Shall i put the following code in
web.xml in my web application or web.xml on config folder, shall i use
server.xml or context.xml

On 5/24/07, David Rodríguez Fernández <d-...@chronoexpres.com> wrote:
>
> I'm using tomcat 5.5, and for this kind of things i'm creating a xml file
> in
> the {TOMCATHOME}/conf/Catalina/localhost/AppName.xml
> With a content like this:
> # cat /etc/tomcat-5.5/Catalina/localhost/AppName.xml
> <Context path="/AppName" docBase="AppName" debug="5" reloadable="true"
> crossContext="true">
>        <Resource name="jdbc/conexion" auth="Container"
> type="javax.sql.DataSource"
>                driverClassName="oracle.jdbc.driver.OracleDriver"
>        url="jdbc:oracle:thin:@192.168.1.1:1521:SIDBD" username="scott"
> password="tiger"
>        maxActiVe="3" maxIdle="1" maxWait="-1" />
> </Context>
>
>
>
>
>
> -----Mensaje original-----
> De: Mohammed Zabin [mailto:jotnarta@gmail.com]
> Enviado el: jueves, 24 de mayo de 2007 12:24
> Para: Tomcat Users List
> Asunto: Re: DBCP
>
> I am using tomcat 6, and another thing, i have changed my configuration
> parameters to the following:
>
>
> <Resource name="jdbc/myoracle" auth="Container"
>              type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.OracleDriver"
>              url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
>              username="scott" password="tiger" maxActive="20" maxIdle="10"
>              maxWait="-1"/>
>
>
>
>
> On 5/24/07, David Rodríguez Fernández <d-...@chronoexpres.com>
> wrote:
> >
> > What tomcat version do you have?
> >
> > -----Mensaje original-----
> > De: Mohammed Zabin [mailto:jotnarta@gmail.com] Enviado el: jueves, 24
> > de mayo de 2007 12:03
> > Para: users@tomcat.apache.org
> > Asunto: DBCP
> >
> > *Hi All*
> > **
> > *I want to use DBCP to connect my localhost Oracle Database, I have
> > write the following in servlet.xml file:*
> >
> > <Resource name="jdbc/myoracledb" auth="Container"
> >                  type="javax.sql.DataSource" />
> >
> >    <ResourceParams name="jdbc/myoracledb">
> >       <parameter>
> >          <name>factory</name>
> >          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> >       </parameter>
> >       <parameter>
> >          <name>driverClassName</name>
> >          <value>oracle.jdbc.OracleDriver</value>
> >       </parameter>
> >       <parameter>
> >          <name>url</name>
> >          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
> >       </parameter>
> >       <parameter>
> >          <name>username</name>
> >          <value>hr</value>
> >       </parameter>
> >       <parameter>
> >          <name>password</name>
> >          <value>hr</value>
> >       </parameter>
> >       <parameter>
> >          <name>maxActive</name>
> >          <value>20</value>
> >       </parameter>
> >       <parameter>
> >          <name>maxIdle</name>
> >          <value>10</value>
> >       </parameter>
> >       <parameter>
> >          <name>maxWait</name>
> >          <value>-1</value>
> >       </parameter>
> >    </ResourceParams>
> > </GlobalNamingResources>
> >
> > *and the following in web.xml file:*
> >
> > <resource-ref>
> >   <description>Oracle Datasource example</description>
> >   <res-ref-name>jdbc/myoracledb</res-ref-name>
> >   <res-type>javax.sql.DataSource</res-type>
> >   <res-auth>Container</res-auth>
> > </resource-ref>
> >
> > *and following is my JSP code:*
> >
> >
> > <%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>
> >
> > <%
> > Context initContext = new InitialContext(); Context envContext  =
> > (Context)initContext.lookup("java:/comp/env");
> > DataSource ds = (DataSource)envContext.lookup("jdbc/myoracledb");
> > Connection conn = ds.getConnection();
> >
> > out.println( "Connection Established" ); %>
> >
> > *When running the above jsp page, i got the following exception:*
> >
> > *org.apache.jasper.JasperException: javax.servlet.ServletException:
> > org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> > driver of class '' for connect URL 'null'
> >
> > org.apache.jasper.servlet.JspServletWrapper.handleJspException
> > (JspServletWra
> > pper.java:532)
> >
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> > java
> > :4
> > 08)
> >
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> >        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
> >
> > Any Help Please, I am working to solving this problem from one week, I
> > am lost, what is the reason for this exception, any help will be
> > apprecieated
> >
> > Jotnarta
> >
> >
> >
> >
> > ----------------------------------------------------------------------
> >
> > La Información incluida en el presente correo electrónico es SECRETO
> > PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
> > destinatario arriba mencionado. Si usted lee este mensaje y no es el
> > destinatario señalado, el empleado o el agente responsable de entregar
> > el mensaje al destinatario, o ha recibido esta comunicación por error,
> > le informamos que esta totalmente prohibida cualquier divulgación,
> > distribución o reproducción de esta comunicación, y le rogamos que nos
> > lo notifique inmediatamente y nos devuelva el mensaje original a la
> > dirección arriba mencionada.
> >
> > Gracias.
> >
> > The information contained in this e-mail is LEGALLY PRIVILEDGED AND
> > CONFIDENTIAL and is intended only for the use of the addressee named
> > above. If the reader of this message is not the intended recipient or
> > the employee or agent responsible for delivering the message to the
> > intended recipient, or you have received this communication in error,
> > please be aware that any dissemination, distribution or duplication of
> > this communication is strictly prohibited, and please notify us
> > immediately and return the original message to us at the address above.
> >
> > Thank you.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> > e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
>
>
> ----------------------------------------------------------------------
>
> La Información incluida en el presente correo electrónico es SECRETO
> PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
> destinatario arriba mencionado. Si usted lee este mensaje y no es el
> destinatario señalado, el empleado o el agente responsable de entregar
> el mensaje al destinatario, o ha recibido esta comunicación por error,
> le informamos que esta totalmente prohibida cualquier divulgación,
> distribución o reproducción de esta comunicación, y le rogamos que nos
> lo notifique inmediatamente y nos devuelva el mensaje original a la
> dirección arriba mencionada.
>
> Gracias.
>
> The information contained in this e-mail is LEGALLY PRIVILEDGED AND
> CONFIDENTIAL and is intended only for the use of the addressee named
> above. If the reader of this message is not the intended recipient or
> the employee or agent responsible for delivering the message to the
> intended recipient, or you have received this communication in error,
> please be aware that any dissemination, distribution or duplication of
> this communication is strictly prohibited, and please notify us
> immediately and return the original message to us at the address above.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: DBCP

Posted by David Rodríguez Fernández <d-...@chronoexpres.com>.
I'm using tomcat 5.5, and for this kind of things i'm creating a xml file in
the {TOMCATHOME}/conf/Catalina/localhost/AppName.xml
With a content like this:
# cat /etc/tomcat-5.5/Catalina/localhost/AppName.xml
<Context path="/AppName" docBase="AppName" debug="5" reloadable="true"
crossContext="true">
        <Resource name="jdbc/conexion" auth="Container"
type="javax.sql.DataSource"
                driverClassName="oracle.jdbc.driver.OracleDriver"
        url="jdbc:oracle:thin:@192.168.1.1:1521:SIDBD" username="scott"
password="tiger"
        maxActiVe="3" maxIdle="1" maxWait="-1" />
</Context>





-----Mensaje original-----
De: Mohammed Zabin [mailto:jotnarta@gmail.com] 
Enviado el: jueves, 24 de mayo de 2007 12:24
Para: Tomcat Users List
Asunto: Re: DBCP

I am using tomcat 6, and another thing, i have changed my configuration
parameters to the following:


<Resource name="jdbc/myoracle" auth="Container"
              type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
              url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
              username="scott" password="tiger" maxActive="20" maxIdle="10"
              maxWait="-1"/>




On 5/24/07, David Rodríguez Fernández <d-...@chronoexpres.com> wrote:
>
> What tomcat version do you have?
>
> -----Mensaje original-----
> De: Mohammed Zabin [mailto:jotnarta@gmail.com] Enviado el: jueves, 24 
> de mayo de 2007 12:03
> Para: users@tomcat.apache.org
> Asunto: DBCP
>
> *Hi All*
> **
> *I want to use DBCP to connect my localhost Oracle Database, I have 
> write the following in servlet.xml file:*
>
> <Resource name="jdbc/myoracledb" auth="Container"
>                  type="javax.sql.DataSource" />
>
>    <ResourceParams name="jdbc/myoracledb">
>       <parameter>
>          <name>factory</name>
>          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>       </parameter>
>       <parameter>
>          <name>driverClassName</name>
>          <value>oracle.jdbc.OracleDriver</value>
>       </parameter>
>       <parameter>
>          <name>url</name>
>          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
>       </parameter>
>       <parameter>
>          <name>username</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>password</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>maxActive</name>
>          <value>20</value>
>       </parameter>
>       <parameter>
>          <name>maxIdle</name>
>          <value>10</value>
>       </parameter>
>       <parameter>
>          <name>maxWait</name>
>          <value>-1</value>
>       </parameter>
>    </ResourceParams>
> </GlobalNamingResources>
>
> *and the following in web.xml file:*
>
> <resource-ref>
>   <description>Oracle Datasource example</description>
>   <res-ref-name>jdbc/myoracledb</res-ref-name>
>   <res-type>javax.sql.DataSource</res-type>
>   <res-auth>Container</res-auth>
> </resource-ref>
>
> *and following is my JSP code:*
>
>
> <%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>
>
> <%
> Context initContext = new InitialContext(); Context envContext  = 
> (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracledb");
> Connection conn = ds.getConnection();
>
> out.println( "Connection Established" ); %>
>
> *When running the above jsp page, i got the following exception:*
>
> *org.apache.jasper.JasperException: javax.servlet.ServletException:
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC 
> driver of class '' for connect URL 'null'
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException
> (JspServletWra
> pper.java:532)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> java
> :4
> 08)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
>
> Any Help Please, I am working to solving this problem from one week, I 
> am lost, what is the reason for this exception, any help will be 
> apprecieated
>
> Jotnarta
>
>
>
>
> ----------------------------------------------------------------------
>
> La Información incluida en el presente correo electrónico es SECRETO 
> PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del 
> destinatario arriba mencionado. Si usted lee este mensaje y no es el 
> destinatario señalado, el empleado o el agente responsable de entregar 
> el mensaje al destinatario, o ha recibido esta comunicación por error, 
> le informamos que esta totalmente prohibida cualquier divulgación, 
> distribución o reproducción de esta comunicación, y le rogamos que nos 
> lo notifique inmediatamente y nos devuelva el mensaje original a la 
> dirección arriba mencionada.
>
> Gracias.
>
> The information contained in this e-mail is LEGALLY PRIVILEDGED AND 
> CONFIDENTIAL and is intended only for the use of the addressee named 
> above. If the reader of this message is not the intended recipient or 
> the employee or agent responsible for delivering the message to the 
> intended recipient, or you have received this communication in error, 
> please be aware that any dissemination, distribution or duplication of 
> this communication is strictly prohibited, and please notify us 
> immediately and return the original message to us at the address above.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>




----------------------------------------------------------------------

La Información incluida en el presente correo electrónico es SECRETO
PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
destinatario arriba mencionado. Si usted lee este mensaje y no es el
destinatario señalado, el empleado o el agente responsable de entregar
el mensaje al destinatario, o ha recibido esta comunicación por error,
le informamos que esta totalmente prohibida cualquier divulgación,
distribución o reproducción de esta comunicación, y le rogamos que nos
lo notifique inmediatamente y nos devuelva el mensaje original a la
dirección arriba mencionada.

Gracias.

The information contained in this e-mail is LEGALLY PRIVILEDGED AND
CONFIDENTIAL and is intended only for the use of the addressee named
above. If the reader of this message is not the intended recipient or
the employee or agent responsible for delivering the message to the
intended recipient, or you have received this communication in error,
please be aware that any dissemination, distribution or duplication of
this communication is strictly prohibited, and please notify us
immediately and return the original message to us at the address above.

Thank you.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: DBCP

Posted by Mohammed Zabin <jo...@gmail.com>.
I am using tomcat 6, and another thing, i have changed my configuration
parameters to the following:


<Resource name="jdbc/myoracle" auth="Container"
              type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
              url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
              username="scott" password="tiger" maxActive="20" maxIdle="10"
              maxWait="-1"/>




On 5/24/07, David Rodríguez Fernández <d-...@chronoexpres.com> wrote:
>
> What tomcat version do you have?
>
> -----Mensaje original-----
> De: Mohammed Zabin [mailto:jotnarta@gmail.com]
> Enviado el: jueves, 24 de mayo de 2007 12:03
> Para: users@tomcat.apache.org
> Asunto: DBCP
>
> *Hi All*
> **
> *I want to use DBCP to connect my localhost Oracle Database, I have write
> the following in servlet.xml file:*
>
> <Resource name="jdbc/myoracledb" auth="Container"
>                  type="javax.sql.DataSource" />
>
>    <ResourceParams name="jdbc/myoracledb">
>       <parameter>
>          <name>factory</name>
>          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>       </parameter>
>       <parameter>
>          <name>driverClassName</name>
>          <value>oracle.jdbc.OracleDriver</value>
>       </parameter>
>       <parameter>
>          <name>url</name>
>          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
>       </parameter>
>       <parameter>
>          <name>username</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>password</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>maxActive</name>
>          <value>20</value>
>       </parameter>
>       <parameter>
>          <name>maxIdle</name>
>          <value>10</value>
>       </parameter>
>       <parameter>
>          <name>maxWait</name>
>          <value>-1</value>
>       </parameter>
>    </ResourceParams>
> </GlobalNamingResources>
>
> *and the following in web.xml file:*
>
> <resource-ref>
>   <description>Oracle Datasource example</description>
>   <res-ref-name>jdbc/myoracledb</res-ref-name>
>   <res-type>javax.sql.DataSource</res-type>
>   <res-auth>Container</res-auth>
> </resource-ref>
>
> *and following is my JSP code:*
>
>
> <%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>
>
> <%
> Context initContext = new InitialContext();
> Context envContext  = (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracledb");
> Connection conn = ds.getConnection();
>
> out.println( "Connection Established" ); %>
>
> *When running the above jsp page, i got the following exception:*
>
> *org.apache.jasper.JasperException: javax.servlet.ServletException:
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
> of
> class '' for connect URL 'null'
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException
> (JspServletWra
> pper.java:532)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :4
> 08)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
>
> Any Help Please, I am working to solving this problem from one week, I am
> lost, what is the reason for this exception, any help will be apprecieated
>
> Jotnarta
>
>
>
>
> ----------------------------------------------------------------------
>
> La Información incluida en el presente correo electrónico es SECRETO
> PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
> destinatario arriba mencionado. Si usted lee este mensaje y no es el
> destinatario señalado, el empleado o el agente responsable de entregar
> el mensaje al destinatario, o ha recibido esta comunicación por error,
> le informamos que esta totalmente prohibida cualquier divulgación,
> distribución o reproducción de esta comunicación, y le rogamos que nos
> lo notifique inmediatamente y nos devuelva el mensaje original a la
> dirección arriba mencionada.
>
> Gracias.
>
> The information contained in this e-mail is LEGALLY PRIVILEDGED AND
> CONFIDENTIAL and is intended only for the use of the addressee named
> above. If the reader of this message is not the intended recipient or
> the employee or agent responsible for delivering the message to the
> intended recipient, or you have received this communication in error,
> please be aware that any dissemination, distribution or duplication of
> this communication is strictly prohibited, and please notify us
> immediately and return the original message to us at the address above.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: DBCP

Posted by David Rodríguez Fernández <d-...@chronoexpres.com>.
What tomcat version do you have? 

-----Mensaje original-----
De: Mohammed Zabin [mailto:jotnarta@gmail.com] 
Enviado el: jueves, 24 de mayo de 2007 12:03
Para: users@tomcat.apache.org
Asunto: DBCP

*Hi All*
**
*I want to use DBCP to connect my localhost Oracle Database, I have write
the following in servlet.xml file:*

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

    <ResourceParams name="jdbc/myoracledb">
       <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
       </parameter>
       <parameter>
          <name>driverClassName</name>
          <value>oracle.jdbc.OracleDriver</value>
       </parameter>
       <parameter>
          <name>url</name>
          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
       </parameter>
       <parameter>
          <name>username</name>
          <value>hr</value>
       </parameter>
       <parameter>
          <name>password</name>
          <value>hr</value>
       </parameter>
       <parameter>
          <name>maxActive</name>
          <value>20</value>
       </parameter>
       <parameter>
          <name>maxIdle</name>
          <value>10</value>
       </parameter>
       <parameter>
          <name>maxWait</name>
          <value>-1</value>
       </parameter>
    </ResourceParams>
  </GlobalNamingResources>

*and the following in web.xml file:*

<resource-ref>
   <description>Oracle Datasource example</description>
   <res-ref-name>jdbc/myoracledb</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
</resource-ref>

*and following is my JSP code:*


<%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>

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

  out.println( "Connection Established" ); %>

*When running the above jsp page, i got the following exception:*

*org.apache.jasper.JasperException: javax.servlet.ServletException:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null'
	
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:532)
	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:4
08)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*

Any Help Please, I am working to solving this problem from one week, I am
lost, what is the reason for this exception, any help will be apprecieated

Jotnarta




----------------------------------------------------------------------

La Información incluida en el presente correo electrónico es SECRETO
PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
destinatario arriba mencionado. Si usted lee este mensaje y no es el
destinatario señalado, el empleado o el agente responsable de entregar
el mensaje al destinatario, o ha recibido esta comunicación por error,
le informamos que esta totalmente prohibida cualquier divulgación,
distribución o reproducción de esta comunicación, y le rogamos que nos
lo notifique inmediatamente y nos devuelva el mensaje original a la
dirección arriba mencionada.

Gracias.

The information contained in this e-mail is LEGALLY PRIVILEDGED AND
CONFIDENTIAL and is intended only for the use of the addressee named
above. If the reader of this message is not the intended recipient or
the employee or agent responsible for delivering the message to the
intended recipient, or you have received this communication in error,
please be aware that any dissemination, distribution or duplication of
this communication is strictly prohibited, and please notify us
immediately and return the original message to us at the address above.

Thank you.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org