You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by dimos <tr...@yahoo.com> on 2007/04/20 11:45:28 UTC
Tomcat 5.5 Connection Pooling problem
Hi,
I am trying to setup JDBC connection pooling in Tomcat
5.5 using DB2 database and IBM RAD 7.0 IDE. Although
The setup described in JNDI Resources
HOW-TO(http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html)
for creating JDBC Datasources did work, I would like
to work with real connection pooling, which means not
declaring datasources into the /META-INF/context.xml
file of each web app but having them as
<GlobalNamingResources>
into /conf/server.xml and accessing them through
<ResourceLink>
references from /conf/context.xml (or
/conf/catalina/localhost/ROOT.xml). However I am stuck
with Exception
javax.naming.NameNotFoundException: Name jdbc is not
bound in this Context
. Even if I add an:
<resource-env-ref>
<description>
</description>
<resource-env-ref-name>jdbc/DB2T</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
record in my /WEB-INF/web.xml I get a
javax.naming.NamingException: Cannot create resource
instance
Exception.
Does anyone have an idea how to resolve this?
Here are my configurations:
-----------------/conf/server.xml-------------------
<Server port="8005" shutdown="SHUTDOWN">
<!-- Global JNDI resources -->
<GlobalNamingResources>
<Resource name="jdbc/DB2T" auth="Container"
type="javax.sql.DataSource" removeAbandoned="true"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
removeAbandonedTimeout="30" maxActive="100"
maxIdle="30" maxWait="10000" username="id"
password="pass"
driverClassName="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://<ip-addrr>:<port>/dbname"/>
</GlobalNamingResources>
------------------/conf/context.xml----------------------
<!-- The contents of this file will be loaded for each
web application -->
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
<ResourceLink name="jdbc/DB2T" global="jdbc/DB2T"
type="javax.sql.DataSource"/>
</Context>
I also try to get the resource with java code like
this:
DataSource ds;
InitialContext DSCtx = new InitialContext();
ds = (DataSource)
DSCtx.lookup("java:/comp/env/jdbc/DB2T");
PS: When I start the tomcat and hit
http://localhost:8080 I can't get the default page
although every web app I run loads without problems.
Do you think this has a relation with the above problem?
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
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