cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject [Patch][C2.0/2.1] Sitemap class name conflict. Bug?
Date Fri, 31 Aug 2001 11:58:34 GMT
All,

the sitemap.xmap file always compiles to org.apache.cocoon.www.sitemap_xmap,
unless one has specified a different root package in cocoon.xconf. Thus, to
run two cocoon webapps, one must specify different root packages for the
program generator in cocoon.xconf. This makes deployment of multiple cocoon
webapps on one server difficult.

Since I am about to be responsible for multiple cocoon webapps not written
nor maintained by me running on one server, I want to avoid the issue
altogether and extend the root package with the context directory name, with
'/', '\', and ':' replaced by '_'.

I have tried with the ParanoidCocoonServlet, as well as setting
init-classloader to true in web.xml and selecting different work
directories. Nothing worked.

/LS

Patch follows:

--- ProgramGeneratorImpl_orig_0.java  Fri Aug 31 13:49:34 2001
+++
org\apache\cocoon\components\language\generator\ProgramGeneratorImpl.java
Fri Aug 31 13:46:18 2001
@@ -130,6 +130,18 @@
         Parameters params = Parameters.fromConfiguration(conf);
         this.autoReload = params.getParameterAsBoolean("auto-reload",
autoReload);
         this.rootPackage = params.getParameter("root-package",
"org.apache.cocoon.www");
+
+        //
+        // Ensure unique root packages for each context directory
+        //
+        String packageSuffix = this.contextDir.replace(':', '_');
+        packageSuffix = packageSuffix.replace('/', '_');
+        packageSuffix = packageSuffix.replace('\\', '_');
+        getLogger().debug("Package suffix is " + packageSuffix);
+
+        this.rootPackage = this.rootPackage + "." + packageSuffix;
+        getLogger().debug("Root package is " + rootPackage);
+
         this.preload = params.getParameterAsBoolean("preload", preload);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message