473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Tomcat 5: files in $CATALINA_HOME/conf/Catalina/localhost

Hello!

I tried to get my J2EE app working with DB2 for several days and now
it seems to work, but... (Tomcat 5.0.19 on NT 4.0 with J2SDK 1.4.1_02)

1) Declaring the DB2-datasource in $CATALINA_HOME/conf/server.xml did
not work.
All I got was a message like "Cannot create JDBC driver of class ''
for connect URL 'null', cause: null"

2) DB2-Driver (COM.ibm.db2.jdbc.app.DB2Driver) is in
CATALINA_HOME/common/lib, file renamed from db2java.zip to db2java.jar

3) I tried to place the ResourceParams in <GlobalNamingResources>,
then in <Context...>, but nothing worked for me...

4) Finally I placed a file myApp.xml in
$CATALINA_HOME/conf/Catalina/localhost and declared the datasource in
this file.

5) This way it works fine now. But here comes the question: Is it "the
right way" to place my config-file in
$CATALINA_HOME/conf/Catalina/localhost?

Thanks for each helpful idea.
Oliver

//--- Content of $CATALINA_HOME/conf/Catalina/localhost/myApp.xml
---------
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="myApp" path="/myApp"
docBase="D:\Programme\jakarta-tomcat-5.0.19\webapps\myApp">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="myApp_log." suffix=".txt"
timestamp="true"/>
<Resource auth="Container" name="jdbc/myApp"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myApp">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFact ory</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>...</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:db2:myApp</value>
</parameter>
<parameter>
<name>driverName</name>/database
<value>jdbc:db2:myApp</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>COM.ibm.db2.jdbc.app.DB2Driver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>username</name>
<value>...</value>
</parameter>
</ResourceParams>
</Context>
// --- EOF -----------
Jul 17 '05 #1
1 15799
Hi Oliver,

i had the same problem. It's not solved, but try to remove the line:

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

from the myApp.xml file and place it into your web.xml of your
application.
Now i am getting the following Exception:

Exception: org.apache.commons.dbcp.SQLNestedException: Cannot create
JDBC driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL
'jdbc:db2:DB', cause: No suitable driver

I placed the db2java.jar in the %CATALINA_HOME%/common/lib and the
application WEB-INF/lib directory. None was succesful.

Hope anybody has a solution.

Greeting
oh*****@hotmail.com (Oliver Hoehle) wrote in message news:<68**************************@posting.google. com>...
Hello!

I tried to get my J2EE app working with DB2 for several days and now
it seems to work, but... (Tomcat 5.0.19 on NT 4.0 with J2SDK 1.4.1_02)

1) Declaring the DB2-datasource in $CATALINA_HOME/conf/server.xml did
not work.
All I got was a message like "Cannot create JDBC driver of class ''
for connect URL 'null', cause: null"

2) DB2-Driver (COM.ibm.db2.jdbc.app.DB2Driver) is in
CATALINA_HOME/common/lib, file renamed from db2java.zip to db2java.jar

3) I tried to place the ResourceParams in <GlobalNamingResources>,
then in <Context...>, but nothing worked for me...

4) Finally I placed a file myApp.xml in
$CATALINA_HOME/conf/Catalina/localhost and declared the datasource in
this file.

5) This way it works fine now. But here comes the question: Is it "the
right way" to place my config-file in
$CATALINA_HOME/conf/Catalina/localhost?

Thanks for each helpful idea.
Oliver

//--- Content of $CATALINA_HOME/conf/Catalina/localhost/myApp.xml
---------
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="myApp" path="/myApp"
docBase="D:\Programme\jakarta-tomcat-5.0.19\webapps\myApp">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="myApp_log." suffix=".txt"
timestamp="true"/>
<Resource auth="Container" name="jdbc/myApp"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/myApp">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFact ory</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>...</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:db2:myApp</value>
</parameter>
<parameter>
<name>driverName</name>/database
<value>jdbc:db2:myApp</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>COM.ibm.db2.jdbc.app.DB2Driver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>username</name>
<value>...</value>
</parameter>
</ResourceParams>
</Context>
// --- EOF -----------

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: moretti | last post by:
Hello I try to see my PHP files through tomcat. Tomcat 5.0.25 (from binaries) PHP 4.3.3 (from RPMs) Linux Suse 9.0 A message asks me to download my PHP file; I cannot open it in my browser...
0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
1
by: Liza | last post by:
Hi, I have upgraded from Tomcat4.0.4 to Tomcat4.1.29 by installing a binary, not an RPM. It looks OK but it won't start at boot time. There are no scripts in /etc/rc.d/init.d/ or /etc/init.d/ All...
1
by: SPG | last post by:
Hi, I am relatively new to TOMCAT, and am trying to deploy a web app using it. I have a domain name that I want to use to access my web app directly. By default, I deploy my WAR, and it deploys...
4
by: jesper | last post by:
Hi there. I have migrated from tomcat 4.1.31 to tomcat 5.5.7 I have a setup with many virtual hosts. I ame using the option in 5.5 to put context information in...
0
by: no-spam | last post by:
Hello group, I have some questions concerning configuring and using a JNDI DataSource with PostgreSQL and Apache Tomcat. Currently, I belive I have successfully configured a "basic" DataSource....
0
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the...
1
by: kommaraju | last post by:
iam a starter to db2 & jdbc.i have a servlet program which connects to ibm db2 using jdbc.when i run this using apache tomcat 4.1.34 , it is showing a error message of HTTP STATUS 500 my jdbc...
0
by: Arun21084 | last post by:
Hi, Recently I installed an application HP SIP(Service Information Portal) on a Windows 2000 server.The application comes along with an installation of Tomcat 5.0.19. Already there was an Apache...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.