Re: DefaultContext + ResourceLink
On Wed, 22 Oct 2003 02:52:52 -0700, Peter Harrison wrote: On Wed, 22 Oct 2003 12:18, Cam Smith wrote: Hi tomcat-dev, I just downloaded the latest builds in the hope that this bug might be fixed: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16116 Unfortunately it still seems to be present. I'm happy to go with 4.1 or 5.0 beta, but could someone please take a look at this? I would have thought that global JDBC datasources plus auto-deployment is a pretty mainstream configuration. The following was posted a couple of days ago, and the bug marked as RESOLVED and FIXED. However, there was also the comment included below which seems to indicate that the resolution was *not* to place JDBC drivers in the common/lib directory, but rather add the JDBC jar to the classpath manually. This is rather confusing. This is a different behavior to Tomcat 4.0.4 (which I'm using now), and is undocuented. Ideally it should be fixed so that the common/lib directory is used, as is the case with older versions. No, you're talking about an unrelated issue. My problem is that ResourceLinks (to a globally declared resource) declared in a DefaultContext element do not propagate to any automatically deployed contexts. This occurs no matter where the driver jar is located. Apart from forcing you to explicity configure each context, it also makes it much harder to use the ant based deployment tasks - in fact I've given up. I downloaded 5.0.13 as comitters on the list have been describing it as stable - but the problem still exists. thanks, Cam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DefaultContext + ResourceLink
Cam Smith wrote: On Wed, 22 Oct 2003 02:52:52 -0700, Peter Harrison wrote: On Wed, 22 Oct 2003 12:18, Cam Smith wrote: Hi tomcat-dev, I just downloaded the latest builds in the hope that this bug might be fixed: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16116 Unfortunately it still seems to be present. I'm happy to go with 4.1 or 5.0 beta, but could someone please take a look at this? I would have thought that global JDBC datasources plus auto-deployment is a pretty mainstream configuration. The following was posted a couple of days ago, and the bug marked as RESOLVED and FIXED. However, there was also the comment included below which seems to indicate that the resolution was *not* to place JDBC drivers in the common/lib directory, but rather add the JDBC jar to the classpath manually. This is rather confusing. This is a different behavior to Tomcat 4.0.4 (which I'm using now), and is undocuented. Ideally it should be fixed so that the common/lib directory is used, as is the case with older versions. No, you're talking about an unrelated issue. My problem is that ResourceLinks (to a globally declared resource) declared in a DefaultContext element do not propagate to any automatically deployed contexts. This occurs no matter where the driver jar is located. Apart from forcing you to explicity configure each context, it also makes it much harder to use the ant based deployment tasks - in fact I've given up. I downloaded 5.0.13 as comitters on the list have been describing it as stable - but the problem still exists. You can include a context file with the webapps you deploy (look in the docs), which will solve your problem. BTW, no committer (except me maybe) stated that 5.0.13 was stable. It is an alpha release. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DefaultContext + ResourceLink
On Sat, 25 Oct 2003 00:54, Remy Maucherat wrote: I downloaded 5.0.13 as comitters on the list have been describing it as stable - but the problem still exists. You can include a context file with the webapps you deploy (look in the docs), which will solve your problem. The problem for me is that in the deployment process we delete the old web application and copy in the new webapp. Yes you can include the resources in a context - but then you need a custom war for every deployment, rather than a generic war which uses whatever data source is defined in server.xml. In our situation each build is certified, ie we run the war on a test server, and that war is certified by the client prior to deployment in the live environment. Anyway, I'm going to stop bleating now and see if I can fx it :) Regards, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DefaultContext + ResourceLink
Peter Harrison wrote: On Sat, 25 Oct 2003 00:54, Remy Maucherat wrote: I downloaded 5.0.13 as comitters on the list have been describing it as stable - but the problem still exists. You can include a context file with the webapps you deploy (look in the docs), which will solve your problem. The problem for me is that in the deployment process we delete the old web application and copy in the new webapp. Yes you can include the resources in a context - but then you need a custom war for every deployment, rather than a generic war which uses whatever data source is defined in server.xml. Well, your generic WAR can contain a /META-INF/context.xml containing the ResourceLink. In our situation each build is certified, ie we run the war on a test server, and that war is certified by the client prior to deployment in the live environment. Anyway, I'm going to stop bleating now and see if I can fx it :) I probably added the support in TC 5. I didn't test, but the patch was a bit obvious. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DefaultContext + ResourceLink
Hi tomcat-dev, I just downloaded the latest builds in the hope that this bug might be fixed: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16116 Unfortunately it still seems to be present. I'm happy to go with 4.1 or 5.0 beta, but could someone please take a look at this? I would have thought that global JDBC datasources plus auto-deployment is a pretty mainstream configuration. thanks, Cam Smith Solid State p: 613 9525 5040 f: 613 9593 8594 m: 0416 150 422 e: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DefaultContext + ResourceLink
On Wed, 22 Oct 2003 12:18, Cam Smith wrote: Hi tomcat-dev, I just downloaded the latest builds in the hope that this bug might be fixed: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16116 Unfortunately it still seems to be present. I'm happy to go with 4.1 or 5.0 beta, but could someone please take a look at this? I would have thought that global JDBC datasources plus auto-deployment is a pretty mainstream configuration. The following was posted a couple of days ago, and the bug marked as RESOLVED and FIXED. However, there was also the comment included below which seems to indicate that the resolution was *not* to place JDBC drivers in the common/lib directory, but rather add the JDBC jar to the classpath manually. This is rather confusing. This is a different behavior to Tomcat 4.0.4 (which I'm using now), and is undocuented. Ideally it should be fixed so that the common/lib directory is used, as is the case with older versions. --- Additional Comments From [EMAIL PROTECTED] 2003-10-20 11:10 --- I have been dealing with the same problem for a few days and managed to find one solution for it. I'm using Tomcat 4.1.27 and Sybase database running on Win2K(also tried in XP and same assembly worked fine). In my server.xml I have Context under host as follows: Context path=/MyApp docBase=MyApp debug=5 reloadable=true crossContext=true Resource name=jdbc/dbref auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/dbref parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value10/value /parameter parameter namemaxIdle/name value2/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameusername/name valuereport/value /parameter parameter namepassword/name valuereport/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybConnectionPoolDataSource/value /parameter parameter nameurl/name valuejdbc:sybase:Tds:xxx:5000/dbname/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter /ResourceParams /Context In my web.xml I have: resource-ref descriptionSybase Datasource/description res-ref-namejdbc/dbref/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref ,and in Java: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); dataSource = (javax.sql.DataSource)envContext.lookup(dataSourceName); Connection con = dataSource.getConnection(); I installed Java 2 Runtime Environment 1.4.2_01 and modified system variables: JAVA_HOME = j2re 1.4.2_01 install dir CLASSPATH = 3rd party database driver jar directory CATALINA_HOME = Tomcat install dir Although Jakarta Tomcat 4.1 JNDI Datasource HOW-TO docs adviced not to install 3rd party database drivers anywhere else than in $CATALINA_HOME/common/lib I tried adding jar into CLASSPATH and it worked fine. Make sure you have jre installed and JAVA_HOME set into that dir and it should work fine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]