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
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.]
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.
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.
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