I had faced a similar situation, but wasn't sure why it was working on
windoze!

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:15 PM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Ok...now the problem is stranger.

I am running this on RedHat Linux.

So I downloaded Tomcat 4.1.12 for Windows (the ZIP file).
I set up Tomcat and the environment variables, and I configured my web app
and Data Source stuff the same way...and it works!

So I'm wondering why I get this error on Linux:
java.sql.SQLException: Cannot load JDBC driver class 'null'


Can I copy my tomcat instance on my Windows machine over to Linux?
Will it run? I'm thinking that might help out find the source of this
problem.


thank you!


-----Original Message-----
From: Thomas Achleitner [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:38 AM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Here are the relevant snapshots of the code (classes12.jar in common/lib):
server.xml:
<Resource name="jdbc/OracleDS" auth="Container"
type="oracle.jdbc.pool.OracleConnectionCacheImpl"/>
<ResourceParams name="jdbc/OracleDS">
<parameter><name>factory</name><value>oracle.jdbc.pool.OracleDataSourceFacto
ry</value></parameter>
<parameter><name>userName</name><value>scott</value></parameter>
<parameter><name>password</name><value>tiger</value></parameter>
<parameter><name>driverClassName</name><value>oracle.jdbc.OracleDriver</valu
e></parameter>
<parameter><name>url</name><value>jdbc:oracle:thin:@testdb:1525:ORA5</value>
</parameter>
</ResourceParams>

web.xml:
<resource-ref>
  <description>Resource reference to a factory for java.sql.Connection
  instances that may be used for talking to a particular
  database that is configured in the server.xml file.</description>
  <res-ref-name>jdbc/OracleDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

Source code that obtains connection:
initCtx = new InitialContext();
envCtx = (Context) initCtx.lookup("java:comp/env");
dataSource = (DataSource) envCtx.lookup("jdbc/OracleDS");
con = dataSource.getConnection();

hope that helps !
thomas

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 5:26 PM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Woa...

Could you send me a copy of your server.xml, web.xml, and how you create the
connection in your Servlet/JSP?

That would be greatly appreciated.


thank you very much!

~ t r o y ~

-----Original Message-----
From: Thomas Achleitner [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:24 AM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


hi!
tomcat 4.1.12
classes12.jar

thomas

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 5:22 PM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Hi Thomas...

What version of Tomcat are you using?
Are you using classes12.jar (zip)?

thanks!

~ t r o y ~


-----Original Message-----
From: Thomas Achleitner [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:15 AM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


hi troy!

You can take oracle.jdbc.OracleDriver as well (the oracle forum told me that
oracle.jdbc.driver.OracleDriver is only kept for backwards compatibility).
If I remove following parameters then it works fine with my application:
    <parameter>
      <name>maxLimit</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>minLimit</name>
      <value>5</value>
    </parameter>
    <parameter>
      <name>cacheScheme</name>
      <value>1</value>
    </parameter>

I think you should have a look at the docu for those parameters. I just have
no idea why they don't work. The parameter user should be changed to
userName as well (casesensitive).

thomas

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 4:53 PM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Hello Thomas,
I take it you mean oracle.jdbc.driver.OracleDriver.
I added it, bounced the server, and still the same dreadful error:

java.sql.SQLException: Cannot load JDBC driver class 'null'


thank you for your help though!

~ t r o y ~


-----Original Message-----
From: Thomas Achleitner [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 10:44 AM
To: Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Hi!
I think paraemter driverClassName is missing. Try:
<parameter><name>driverClassName</name><value>oracle.jdbc.OracleDriver</valu
e></parameter>

hope this helps!

thomas

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 4:36 PM
To: Balzarotti Paolo; Tomcat Users List
Subject: RE: Tomcat 4.1, DBCP and Oracle


Nope...no luck.
Same error:
java.sql.SQLException: Cannot load JDBC driver class 'null'

My server.xml looks like this now:

<Context path="/inventoryServer" docBase="inventoryServer" debug="5"
reloadable="false" crossContext="false">
  <Resource name="jdbc/inventoryPool"
type="oracle.jdbc.pool.OracleConnectionCacheImpl"/>
  <ResourceParams name="jdbc/inventoryPool">
    <parameter>
      <name>factory</name>
      <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:oracle:thin:@myNode:1521:myIstance</value>
    </parameter>
    <parameter>
      <name>user</name>
      <value>myUser</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>myPass</value>
    </parameter>
    <parameter>
      <name>maxLimit</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>minLimit</name>
      <value>5</value>
    </parameter>
    <parameter>
      <name>cacheScheme</name>
      <value>1</value>
    </parameter>
  </ResourceParams>
</Context>



Any ideas?

~ t r o y ~

-----Original Message-----
From: Balzarotti Paolo [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 10:11 AM
To: Campano, Troy
Subject: R: Tomcat 4.1, DBCP and Oracle


No,
they suggest to use an oracle.jdbc.pool.OracleConnectionCacheImpl
and an oracle.jdbc.pool.OracleDataSourceFactory
look in chapter 5
It's an old post, I don't know its validity 8-?

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


 Oracle JDBC DataSource Example
This example shows how to configure Tomcat to use Oracle's JDBC connection
cache data source.

First ensure the Oracle JDBC driver is installed correctly. The Oracle
drivers can typically be located in the $ORACLE_HOME/jdbc/lib directory:

The Oracle JDBC driver must be added to the $CATALINA_HOME/common/lib
directory, so that it can be loaded as a JNDI Resource.
Ensure the driver file(s) has a .jar extension, so that it can be
automatically loaded by Tomcat's class loader.
Add a Tomcat Resource and ResourceParams element to the web application's
Context in the $CATALINA_HOME/conf/server.xml file:

<Context ...> ... <Resource name="jdbc/EmployeeDB"
type="oracle.jdbc.pool.OracleConnectionCacheImpl"/> <ResourceParams
name="jdbc/EmployeeDB"> <parameter> <name>factory</name>
<value>oracle.jdbc.pool.OracleDataSourceFactory</value> </parameter>
<parameter> <name>url</name>
<value>jdbc:oracle:thin:@localhost:1521:EmployeeDB</value> </parameter>
<parameter> <name>user</name> <value>dbusername</value> </parameter>
<parameter> <name>password</name> <value>dbpassword</value> </parameter>
<parameter> <name>maxLimit</name> <value>10</value> </parameter> <parameter>
<name>minLimit</name> <value>5</value> </parameter> <parameter>
<name>cacheScheme</name> <value>1</value> </parameter> </ResourceParams> ...
</Context>
The configuration properties for Oracle's connection cache data source
resource factory (oracle.jdbc.pool.OracleDataSourceFactory) are as follows:

cacheScheme - The connection caching scheme: 1 - Dynamic Scheme; creates
connections as required beyond maxLimit, but will close additional
connections beyond maxLimit when they become available. 2 - Fixed Return
Null Scheme; returns null when no spare connections are available. 3 - Fixed
Wait Scheme; blocks waiting until a spare connection becomes available.
database login password. The default value is Dynamic Scheme.
maxLimit - The maximum number of connections in the pool. The default value
is 10.
minLimit - The minimum number of connections in the pool. The default value
is 0.
password - The database login password.
url - The JDBC connection URL.
user - The database login username.
Add a corresponding resource-env-ref element in the web application's
web.xml file:

<resource-env-ref> <resource-env-ref-name> jdbc/EmployerDB
</resource-env-ref-name> <resource-env-ref-type>
oracle.jdbc.pool.OracleConnectionCacheImpl </resource-env-ref-type>
<resource-env-ref>
Note the OracleConnectionCacheImpl class implements the javax.sql.DataSource
interface, and should be used like a regular data source.

> -----Messaggio originale-----
> Da: Campano, Troy [mailto:[EMAIL PROTECTED]]
> Inviato: luned́ 9 dicembre 2002 16.08
> A: Balzarotti Paolo
> Oggetto: RE: Tomcat 4.1, DBCP and Oracle
>
>
> Is that the same thing as this?
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasourc
> e-examples-howto.html
>
>
> -----Original Message-----
> From: Balzarotti Paolo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 10:02 AM
> To: Campano, Troy
> Subject: R: Tomcat 4.1, DBCP and Oracle
>
>
> Hello Troy,
> look at this
> http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg2
> 7217.html
>
> > -----Messaggio originale-----
> > Da: Campano, Troy [mailto:[EMAIL PROTECTED]]
> > Inviato: luned́ 9 dicembre 2002 15.30
> > A: Balzarotti Paolo
> > Oggetto: RE: Tomcat 4.1, DBCP and Oracle
> >
> >
> > Hi Paolo,
> > No, nothing has worked yet...unfortunately.
> >
> > ~ T r o y ~
> >
> > -----Original Message-----
> > From: Balzarotti Paolo [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, December 09, 2002 5:56 AM
> > To: Campano, Troy
> > Subject: Tomcat 4.1, DBCP and Oracle
> >
> >
> > Hello Troy,
> > have you solved your problem with Tomcat?
> > I've a similar problem: right configuration (I hope!), but when I
> > launch the test page like the one in the tomcat-docs I see the
> > system out until
> >  System.out.println("**** init 4.1 " + ds.toString());
> > reported in the listing and the browser goes in guru meditation
> > ...ahummmmmmmmm...
> >
> > public void init() {
> >         try{
> >             System.out.println("**** init 1");
> >             Context initContext  = new InitialContext();
> >             Context envContext  =
> > (Context)initContext.lookup("java:/comp/env");
> >             System.out.println("**** init 2");
> >
> >             if(initContext  == null ){
> >                 System.out.println("**** init 2.1");
> >                 throw new Exception("Boom - No Context");
>
> >             }
> >             System.out.println("**** init 3");
> >             DataSource ds =
> > (DataSource)envContext.lookup("jdbc/unifondiDS");
> >
> >             System.out.println("**** init 4");
> >             if (ds != null) {
> >                 System.out.println("**** init 4.1");
> >                 System.out.println("**** init 4.1 " +
> ds.getClass());
> >                 System.out.println("**** init 4.1 " +
> ds.toString());
> >
> >                 Connection conn = ds.getConnection();
> >                 System.out.println("**** init 4.2");
> >                 if(conn != null)  {
> >                     System.out.println("**** init 4.2.1");
> >                     foo = "Got Connection "+conn.toString();
> >                     Statement stmt = conn.createStatement();
> >                     System.out.println("**** init 4.2.2");
> >                     ResultSet rst =
> >                     stmt.executeQuery(
> >                     "select * from anintric where COGNOME  =
> > 'PIPPO'");
> >                     System.out.println("**** init 4.2.3");
> >                     if(rst.next()) {
> >                         System.out.println("**** init 4.2.3.1");
> >                         foo=rst.getString(2);
> >                         bar=rst.getInt(3);
> >                     }
> >                     System.out.println("**** init 4.2.4");
> >                     conn.close();
> >                 }
> >             }
> >         }catch(Exception e) {
> >             e.printStackTrace();
> >         }
> >     }
> >
>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to