cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jndi-datasource-examples-howto.xml
yoavs 2005/03/30 09:23:23 Modified:webapps/docs changelog.xml jndi-datasource-examples-howto.xml Log: Bugzilla 34237. Revision ChangesPath 1.277 +4 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- changelog.xml 30 Mar 2005 17:04:09 - 1.276 +++ changelog.xml 30 Mar 2005 17:23:23 - 1.277 @@ -32,6 +32,10 @@ update bug33522/bug: Update jasper-howto to reflect use of javac switch. (yoavs) /update + update +bug34237/bug: Added note and links to context and host configuration + references in JNDI DataSources HowTo to aid the clueless. (yoavs) + /update /changelog /subsection subsection name=Catalina 1.15 +15 -1 jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml Index: jndi-datasource-examples-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jndi-datasource-examples-howto.xml26 Mar 2005 03:16:18 - 1.14 +++ jndi-datasource-examples-howto.xml30 Mar 2005 17:23:23 - 1.15 @@ -47,6 +47,14 @@ resource configurations to match the syntax in the example below in order to make them work in Tomcat 5.5.x. /p + +p +Also, please note that JNDI DataSource configuration in general, and this +tutorial in particular, assumes that you have read and understood the +a href=config/context.htmlContext/a and +a href=config/host.htmlHost/a configuration references, including +the section about Automatic Application Deployment in the latter reference. +/p /section section name=Database Connection Pool (DBCP) Configurations @@ -189,7 +197,13 @@ pConfigure the JNDI DataSource in Tomcat by adding a declaration for your resource to code$CATALINA_HOME/conf/server.xml/code./p pAdd this in between the codelt;/Contextgt;/code tag of the examples -context and the codelt;/Hostgt;/code tag closing the localhost definition.source +context and the codelt;/Hostgt;/code tag closing the localhost definition. +If there is no such tag, you can add one as illustrated in the +a href=config/context.htmlContext/a and +a href=config/host.htmlHost/a configuration references, and repeated below +for your convenience. + +source lt;Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=truegt; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jndi-datasource-examples-howto.xml
yoavs 2005/03/25 19:16:18 Modified:webapps/docs changelog.xml jndi-datasource-examples-howto.xml Log: Bugzilla 33755. Revision ChangesPath 1.272 +4 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.271 retrieving revision 1.272 diff -u -r1.271 -r1.272 --- changelog.xml 25 Mar 2005 22:24:20 - 1.271 +++ changelog.xml 26 Mar 2005 03:16:18 - 1.272 @@ -60,6 +60,10 @@ add bug33325/bug: Added top-level clean target to Netbuild build.xml file. (yoavs) /add + update +bug33755/bug: Clarified Postgresql JNDI datasource example. [patch submitted by + Tom Witmer] (yoavs) + /update /changelog /subsection 1.14 +84 -7 jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml Index: jndi-datasource-examples-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jndi-datasource-examples-howto.xml27 Sep 2004 16:00:31 - 1.13 +++ jndi-datasource-examples-howto.xml26 Mar 2005 03:16:18 - 1.14 @@ -30,7 +30,7 @@ section name=Introduction pJNDI Datasource configuration is covered extensively in the -JNDI-Resources-HOWTO however, feedback from codetomcat-user/code has +JNDI-Resources-HOWTO. However, feedback from codetomcat-user/code has shown that specifics for individual configurations can be rather tricky./p pHere then are some example configurations that have been posted to @@ -41,6 +41,12 @@ know if you have any other tested configurations that you feel may be of use to the wider audience, or if you feel we can improve this section in anyway./p +p +bPlease note that JNDI resource configuration has changed somewhat between +Tomcat 5.0.x and Tomcat 5.5.x./b You will most likely need to modify your JNDI +resource configurations to match the syntax in the example below in order +to make them work in Tomcat 5.5.x. +/p /section section name=Database Connection Pool (DBCP) Configurations @@ -335,16 +341,65 @@ subsection name=PostgreSQL h30.Introduction/h3 -pPostgreSQL is configured in a similar manner to Oracle. Again, highlighting the differences. -These notes are untested as yet and we would appreciate feedback./p -h31.server.xml configuration/h3 +pPostgreSQL is configured in a similar manner to Oracle./p + +h31. Required files /h3 +p +Copy the Postgres JDBC jar to $CATALINA_HOME/common/lib. As with Oracle, the +jars need to be in this directory in order for DBCP's Classloader to find +them. This has to be done regardless of which configuration step you take next. +/p + +h32. Resource configuration/h3 + +p +You have two choices here: define a datasource that is shared across all Tomcat +applications, or define a datasource specifically for one application. +/p + +h42a. Shared resource configuration/h4 +p +Use this option if you wish to define a datasource that is shared across +multiple Tomcat applications, or if you just prefer defining your datasource +in this file. +/p +piThis author has not had success here, although others have reported so. +Clarification would be appreciated here./i/p + source lt;Resource name=jdbc/postgres auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql://127.0.0.1:5432/mydb - username=myuser password=mypasswd maxActive=20 maxIdle=10 maxWait=-1/ + username=myuser password=mypasswd maxActive=20 maxIdle=10 maxWait=-1/gt; /source -h32.web.xml configuration/h3 +h42b. Application-specific resource configuration/h4 + +p +Use this option if you wish to define a datasource specific to your application, +not visible to other Tomcat applications. This method is less invasive to your +Tomcat installation. +/p + +p +Create a resource definition file for your application defining the +datasource. This file must have the same name as your application, so if +your application deploys as codesomeApp.war/code, this filename must +be codesomeApp.xml/code. This file should look something like the following. +/p + +source +lt;Context path=/someApp docBase=someApp + crossContext=true reloadable=true debug=1gt; + +lt;Resource name=jdbc/postgres auth=Container + type=javax.sql.DataSource driverClassName=org.postgresql.Driver +
cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jndi-datasource-examples-howto.xml
yoavs 2004/08/30 12:35:37 Modified:webapps/docs Tag: TOMCAT_5_0 changelog.xml jndi-datasource-examples-howto.xml Log: Fixed syntax in sample web.xml, addressing Bugzilla 30756. Revision ChangesPath No revision No revision 1.70.2.16 +3 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.70.2.15 retrieving revision 1.70.2.16 diff -u -r1.70.2.15 -r1.70.2.16 --- changelog.xml 30 Aug 2004 19:22:36 - 1.70.2.15 +++ changelog.xml 30 Aug 2004 19:35:37 - 1.70.2.16 @@ -20,6 +20,9 @@ update Added Xalan note in RELEASE-NOTE section on XML parsers. (yoavs) /update + fix +bug30756/bug: Bad syntax in sample web.xml. (yoavs) + /fix /changelog /subsection subsection name=Catalina 1.8.2.2 +0 -1 jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml Index: jndi-datasource-examples-howto.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jndi-datasource-examples-howto.xml,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- jndi-datasource-examples-howto.xml21 Aug 2004 15:50:06 - 1.8.2.1 +++ jndi-datasource-examples-howto.xml30 Aug 2004 19:35:37 - 1.8.2.2 @@ -294,7 +294,6 @@ xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4gt; -lt;web-appgt; lt;descriptiongt;MySQL Test Applt;/descriptiongt; lt;resource-refgt; lt;descriptiongt;DB Connectionlt;/descriptiongt; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]