Classpath and ManagedConnectionPools.xml

I have tested the TConnectionPoolManager successfully with JUnit by making sure my classpath included ManagedConnectionPools.xml . However, when I place ManagedConnectionPools.xml in my webapp’s WEB-INF/lib directory on Tomcat 4.0.1, and attempt to run my web application, I get the following error:

com.softwareag.tamino.db.API.common.TPreconditionViolation: ManagedConnectionPools.xml could not be located within the classpath! TConnectionPoolManager not usable!

the structure under my webapps directory in tomcat is:

wem/
css/
images/
js/
META-INF/
pages/
WEB-INF/
web.xml
classes/mypackage names and classes
lib/
required app jars and
ManagedConnectionPools.xml

The last I knew anything in the WEB-INF/lib directory is included in your classpath by Tomcat.
Apache_Tomcat-4_0_1_-_Error_report.htm (4.19 KB)

If you change Tomcat’s classpath (in catalina.bat) to include a convenient directory such as D:\Resources and you put ManagedConnectionPools.xml into that directory, it will work.

[This message was edited by Bill Leeney on 14 Feb 2002 at 14:41.]

Hi,

this morning I read your message about the TConnectionPool. I want to use it as well with Tomcat 3.2.xxx (I think). Could you send me some code examples how you use it in your java application?

Thanks,
Harald

quote:
Originally posted by Scudman:
I have tested the TConnectionPoolManager successfully with JUnit by making sure my classpath included ManagedConnectionPools.xml . However, when I place ManagedConnectionPools.xml in my webapp’s WEB-INF/lib directory on Tomcat 4.0.1, and attempt to run my web application, I get the following error:

com.softwareag.tamino.db.API.common.TPreconditionViolation: ManagedConnectionPools.xml could not be located within the classpath! TConnectionPoolManager not usable!

the structure under my webapps directory in tomcat is:

wem/
css/
images/
js/
META-INF/
pages/
WEB-INF/
web.xml
classes/mypackage names and classes
lib/
required app jars and
ManagedConnectionPools.xml

The last I knew anything in the WEB-INF/lib directory is included in your classpath by Tomcat.


Here’s an example…
PooledConnection.zip (1.3 KB)

I have tried to add the path to the windows environment CLASSPATH (the folder where ManagedConnectionPools.xml is located) and that works fine if I start tomcat (v. 3.2.3) from its bat-file. But when I start tomcat as a windows service (and changed wrapper.properties) that solution doesn?t work. Any suggestions?

quote:
Originally posted by Bill Leeney:
If you change Tomcat’s classpath (in catalina.bat) to include a convenient directory such as D:\Resources and you put ManagedConnectionPools.xml into that directory, it will work.

[This message was edited by Bill Leeney on 14 Feb 2002 at 14:41.]


I try to run the example of Bill Leeney
but I have the following error.
I have the ManagedConnectionPools.xml
on the classpath and the database is runnig correctly
Any suggest?
Thank and regards.

Esteban
--------------------------------------------------
Exception in thread “main” Nested Exception (com.softwareag.tamino.db.API.connec
tion.TServerNotAvailableException) stacktrace:

Nested Exception (com.softwareag.tamino.db.API.invocation.TInvocationException)
stacktrace:

Nested Exception (java.lang.reflect.InvocationTargetException) stacktrace:

[…]

[This message was edited by Esteban Jos

What exactly have you coded in your element?

It seems an example for Tomcat and jsp might be useful. To install this example:

1) Create a new directory in \webapps called connpool and unzip Connpool.zip into it. Check: You should now have directory called \webapps\connpool containing Test.jsp and a further directory called Web-Inf. Web-Inf should contain web.xml and a directory, lib, complete with all needed jar files.

2) Unzip Resources.zip into . Check: You should now have a directory called resources under and it should contain ManagedConnectionPools.xml. Modify this file to match your database URI.

3) Modify Test.jsp in \webapps\connpool and set the values of:
String DATABASE_COLLECTION = “CSG”;
String DATABASE_DOCTYPE = “resreq”;
String POOL_NAME = “TestPool”;
to match your required values.

4) Configure Tomcat.
If you run Tomcat from catalina.bat, you need to put the resources directory in classpath by adding the following line to setclasspath.bat in tomcat’s bin directory:
after:
set CLASSPATH=%JAVA_HOME%\lib\tools.jar
add:
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\resources;

If you run Tomcat as a service, you need to change file wrapper.properties in directory \conf\jk\ (assuming you are using jk_nt_service):
after:
wrapper.class_path=$(wrapper.java_home)\lib\tools.jar
add:
wrapper.class_path=$(wrapper.tomcat_home)\resources

Now start Tomcat and run the example using a URL like http://localhost:8080/connpool/Test.jsp.

This all works for me - hope it works for you!

Resources.zip
resources.zip (435 Bytes)

Hi Bill,
I find that your example didn’t work because I had not put the log4j-core.jar on the classpath.
Thank you very much!!!