You have the same problem that a number of people
stumbled on last week. Finally, the problem was
solved after days of struggle. Please find the Tomcat
configuration procedure in the attachment.
Contact me if you have further questions.
--- David Short <[EMAIL PROTECTED]> wrote:
> Copy the Oracle JDBC classes file classes12.zip
> (rename to classes12.jar)
> into your Tomcat\common\lib directory.
>
> -----Original Message-----
> From: Peter Shankey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 22, 2004 8:44 AM
> To: Tomcat Users List
> Subject: Loading Oracle Driver Problems
>
>
> Use Tomcat version 5.0.19 with Oracle 9.2.0.4
>
> I have tried to follow the Tomcat instruction but
> somewhere along the line I
> have missed something:
>
> 1) I have copied all jar files from
> $ORACLE_HOME/jdbc/lib to
> $CATALINA_HOME/common/lib
>
> 2) Here is the web.xml file:
> <resource-ref>
> <description>Oracle Datasource
> example</description>
> <res-ref-name>jdbc/myoracle</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> 3) Here is the server.xml file, I put this section
> between the Host tags in
> the xml file:
>
> <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>driverClassName</name>
>
> <value>oracle.jdbc.driver.OracleDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
>
>
<value>jdbc:oracle:thin:@192.168.1.101:1521:to1</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>test</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>test</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>
>
> 4) Here is the bean I am trying to use:
> package mybean;
>
> import java.beans.*;
> import java.io.Serializable;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.sql.DataSource;
> import java.sql.Connection;
> import java.sql.*;
>
> public class testDBConn extends Object implements
> Serializable {
>
>
> public testDBConn() throws Exception {
> Context initContext = new InitialContext();
> Context envContext =
> (Context)initContext.lookup("java:/comp/env");
> DataSource ds =
> (DataSource)envContext.lookup("jdbc/myoracle");
> Connection conn = ds.getConnection();
> }
>
>
> }
>
> The error I keep receiving is:
> MonitorFilter::javax.servlet.ServletException:
> Cannot create JDBC driver of
> class '' for connect URL 'null', cause: No suitable
> driver
>
>
> I am unsure where I am dropping the ball on this
> issue If you have any ideas
> please let me know.
>
>
> Thanks
> Pete
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.comTomcat 5.0.27, j2sdk1.4.2 and Windows XP, Oracle 9i
Step 1.
DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of
Jakarta-Commons componenets:
Jakarta-Commons DBCP 1.2.1
Jakarta-Commons Collections 2.1.1
Jakarta-Commons Pool 1.2
These jar files along with your the jar file for your JDBC driver should be installed
in
$CATALINA_HOME/common/lib.
NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds
$CATALINA_HOME/common/lib/*.jar to the classpath.
Step 2.
download the most up-to-date version of the classes12.zip rename it to classes12.jar
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
and place it in TOMCAT_HOME\common\lib
Step 3.
check the read and execute access to the classes12.jar file (by right-click on the
file and
look for 'properties')
Step 4. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration
Note: I added the following code in between the <realm .../> element and the <Host>
element.
<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>your password</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@172.19.47.22:1521:SystemID</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>your username</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>
Step 5. web.xml Configuration (the one in MyApp/WEB-INF directory)
add these lines after the <taglib> element
**********************
<resource-ref>
<description>Oracle Datasource</description>
<res-ref-name>jdbc/OracleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
**********************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]