aspose file tools*
The moose likes Tomcat and the fly likes Have Been Struggling for More Than a Week.  Tomcat Connection Pool Configuration Prob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Have Been Struggling for More Than a Week.  Tomcat Connection Pool Configuration Prob" Watch "Have Been Struggling for More Than a Week.  Tomcat Connection Pool Configuration Prob" New topic
Author

Have Been Struggling for More Than a Week. Tomcat Connection Pool Configuration Prob

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have been struggling with this problem for more than a week. I did follow the JDBC datasource howto (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html). And I posted all the steps that I have taken to configure the Tomcat 5.0.27 connection pool. Nobody has really helped to look into the problem. Tomcat 5.0.27, j2sdk1.4.2, Oracle 10i, Windows XP

I will post all my configuration steps again below the error message. The Tomcat logs file shows:


root cause

org.dhsinfo.content.exceptions.PageDAOSysException:
SQLException: Cannot create JDBC driver of class '' for connect URL 'null'

org.dhsinfo.content.dao.OraclePageDAO.findPages(OraclePageDAO.java:51)

org.dhsinfo.content.PageService.getPages(PageService.java:18)

org.dhsinfo.content.SelectPage.execute(SelectPage.java:29)


The configuration steps that I have taken are listed below:

Step 1.

Jakarta-Commons DBCP 1.2.1
Jakarta-Commons Collections 2.1.1
Jakarta-Commons Pool 1.2

These jar files are installed in
$CATALINA_HOME/common/lib.

Step 2.
download classes12.zip rename it to classes12.jar and place it in
TOMCAT_HOME\common\lib

Step 3. C:\jakarta-tomcat-5.0.27\conf\server.xml configuration
I did put the driver and URL in the C:\jakarta-tomcat-5.0.27\conf\server.xml file (The code shown below is inserted between
the <Logger
className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log."
suffix=".txt" timestamp="true"/> and the
closing </Host> tag).

Step 4. web.xml Configuration (the one in MyApp/WEB-INF directory)

add these lines after the <taglib> element



[ September 14, 2004: Message edited by: JiaPei Jen ]
[ September 14, 2004: Message edited by: JiaPei Jen ]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I think, you should be config Datasource by Tomcat Web Server Adminitration Tool.

It's easy to use and correctly.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Michael Talavera
Greenhorn

Joined: Jul 26, 2004
Posts: 5
I had this problem as well, running examples from the tomcat site and in reference books. One of the problems is that Tomcat no longer uses the server.xml file to hold the <context> information for the JNDI reference. Look in your <tomcat-root>\conf\Catalina\localhost directory for individual xml files for each context. So if your application is myapp, then there will be a myapp.xml file that has all the context-specific information. The advice from the previous posting is correct, use the Tomcat Administration application supplied with Tomcat to set up your Data Source. When you log in, under the Service node, there is a Host node, then a node for each of the contexts of your tomcat installation. Expand the node for your app and click in Data Source. Then add a new Data Source and the appropriate information. You can then place the below code in a jsp page, servlet, or javabean to test it out:



You would need to import java.naming.*, javax.sql.*, and java.sql.* to run the above code.

I hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Have Been Struggling for More Than a Week. Tomcat Connection Pool Configuration Prob