When developing our tomcat applications with eclipse, doing out-rebuild/sysdeo plugin and have the class files written into TOMCAT_HOME/common/classes is an effective approach. For manageability reasons, we need to split our code among several eclipse projects. The problem is if both are configured to place their .class files in TOMCAT_HOME/common/classes that when one project rebuilds, it will wipe the class files of the other one. A great efficiency gain for the development of multiple projects therefore would be to be able to specify additional classes folders in server.xml to be added to the corresponding class-loader
Isn't that what you can already do using the loader entries in conf/catalina.properties?
This is already supported. See the catalina.properties file.
unfortunately, the com.sysdeo.eclipse.tomcat_3.2.1 ignores this "common.loader" attribute of catalina.properties at least with tomcat 5.5
Created attachment 25088 [details] patchApacheTomcat48863.txt oops, sysdeo works ;) but a typo is not seen whatsoever The attached patch helps users find such a configuration error. Pls 1) re-open this bug 2) re-apply 3) consider even using std-out for this error
see also Bug 48870
Thanks for the patch. I applied a variation to 7.0.x (will be in 7.0.9 onwards) and proposed it for 6.0.x
Regarding the patch that is applied to tc7 at r1073047 and is currently proposed for 6.0.x: 1) The calls to ClassLoaderFactory#validateFile(file, type) pass canonical path for DIR and JAR, but not for GLOB. I mean, the following change to be done, for consistency: (in trunk) Index: java/org/apache/catalina/startup/ClassLoaderFactory.java =================================================================== --- java/org/apache/catalina/startup/ClassLoaderFactory.java (revision 1075098) +++ java/org/apache/catalina/startup/ClassLoaderFactory.java (working copy) @@ -187,6 +187,7 @@ set.add(url); } else if (repository.getType() == RepositoryType.GLOB) { File directory=new File(repository.getLocation()); + directory = new File(directory.getCanonicalPath()); if (!validateFile(directory, RepositoryType.GLOB)) { continue; } BTW, with the above change the calls to file.getAbsolutePath() inside of #validateFile() become unnecessary. 2) The following check in ClassLoaderFactory#validateFile(file, type) assumes that Bootstrap.getCatalinaBase() is an absolute (and canonical, because file is canonical) path. But that is not guaranteed to be so: if (!Bootstrap.getCatalinaHome().equals( Bootstrap.getCatalinaBase()) && file.getAbsolutePath().startsWith( Bootstrap.getCatalinaBase())) {
Thanks for the review. Patch updated in 7.0.x for 7.0.9 and proposal for 6.0.x also updated.
Fixed in 6.0.x and will be in 6.0.33 onwards.