Hello.
I'm trying to find the smallest cocoon configuration for a simple xml->html
application. I used original cocoon directory and removed everything i can
from sitemap and configuration. This is OK.
Now i'm trying to remove useless jars, as stated in docs, and restart tomcat
everytime to check my app still works. I succeded from many package (xt.jar
xerces_1_4_3.jar rhino.jar bsf.jar fop-0_20_1-dev.jar batik-libs.jar
jimi-1.0.jar jstyle.jar, junit.jar, velocity.jar), but as soon as i remove
either hsqldb.jar or maybeupload.jar, it breaks (interupted connexion from
the server) with nothing worth in the logs. Most curious is that just putting
the jars back (and restart tomcat, of course) is not enough, i have to put
back every removed jars so far.
I highly suspect they are still some configuration options related to
database of upload lying in configuration files, but i didn't found them. Or
are they default options ?
I use cocoon 2 rc1 on Linux, with tomcat 3.2.3. I'm joining configuration
files.
--
Guillaume Rousse <[EMAIL PROTECTED]>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html
<?xml version="1.0"?>
<cocoon version="2.0">
<!-- ===================== General Components =========================== -->
<!-- The default parser used in the Apache Cocoon 2 system is
org.apache.cocoon.components.parser.JaxpParser.
Apache Cocoon 2 system requires a JAXP 1.1 parser.
If you have problems because your servlet environment uses its own
parser not conforming to JAXP 1.1 try using the alternative
XercesParser instead of the JaxpParser. To activate the XercesParser
move the line below starting with <parser ...> out of this comment block.
You also than have to add a system property to your JVM
(probably on the startup of your servlet engine like this:
-Dorg.apache.cocoon.components.parser.Parser=org.apache.cocoon.components.parser.XercesParser
<parser class="org.apache.cocoon.components.parser.XercesParser"/>
-->
<hsqldb-server/>
<!-- Storing:
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
threadpriority: Indicates the priority of the writer thread.
(1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<store class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
<parameter name="maxobjects" value="100"/>
<parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</store>
<!-- Store Janitor:
freememory = How much free memory shall be available in the jvm
heapsize = Indicates the limit of the jvm memory consumption
cleanupthreadinterval = How often shall the cleanup thread check memory
threadpriority = Indicates the thread priority of the cleanup thread
Be carefull with the heapsize and freememory paramters. Wrong values can
cause high cpu usage.
Example configuration:
Jvm settings:
-Xms100000000 -Xmx200000000
store-janitor settings:
<parameter name="freememory" value="50000000"/>
<parameter name="heapsize" value="150000000"/>
Heapsize must be higher then the -Xms parameter and freememory
between those both.
-->
<store-janitor class="org.apache.cocoon.components.store.StoreJanitorImpl" logger="root.store">
<parameter name="freememory" value="1000000"/>
<parameter name="heapsize" value="60000000"/>
<parameter name="cleanupthreadinterval" value="10"/>
<parameter name="threadpriority" value="5"/>
</store-janitor>
<xslt-processor class="org.apache.cocoon.components.xslt.XSLTProcessorImpl" logger="root.xslt">
<parameter name="use-store" value="true"/>
</xslt-processor>
<!-- The url factory adds special url protocols to the system, they
are then available inside Cocoon, e.g. as a source argument
for one of the sitemap components -->
<url-factory>
<protocol name="resource" class="org.apache.cocoon.components.url.ResourceURLFactory"/>
<protocol name="context" class="org.apache.cocoon.components.url.ContextURLFactory"/>
</url-factory>
<!-- The source handler adds special url protocols to the system, they
are then available inside Cocoon, e.g. as a source argument
for one of the sitemap components. -->
<source-handler/>
<!-- The ProgamGenerator builts programs from a XML document written in
a MarkupLanguage.
auto-reload:
root-package: persistent code repository.
preload: -->
<program-generator>
<parameter name="auto-reload" value="true"/>
<parameter name="root-package" value="org.apache.cocoon.www"/>
<parameter name="preload" value="true"/>
</program-generator>
<!-- The JspGenerator selects a JSPEngine component. The JSPEngine component launches
a JSP servlet engine of your servlet container, feeds the HttpRequest into the JSP
servlet engine, and pipes the jsp response as SAX events into Cocoon2. The JSP page
is specified by the HttpRequest. This way you can continue to use your JSP pages.
Your migration from JSP to XSP may be done step by step. You may specify your JSP
pages either as JSP scriptlets or as JSP-XML. But keep in mind that your JSP output
should be valid XML. -->
<jsp-engine>
<parameter name="servlet-class" value="org.apache.jasper.servlet.JspServlet"/>
<parameter name="servlet-name" value="*.jsp"/>
</jsp-engine>
<programming-languages>
<java-language name="java">
<!-- compiler parameter specifies which class to use to compile Java.
Possible variants are Javac and Jikes compilers.
Javac requires javac.jar (included with Cocoon distribution).
Jikes requires IBM jikes compiler to be present in the PATH -->
<parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Javac"/>
<!-- Specifies which formatter to use to format source code.
This parameter is optional. -->
<parameter name="code-formatter" value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
<!-- A singleton-like implementation of a ClassLoader -->
<parameter name="class-loader" value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
</java-language>
</programming-languages>
<!-- A singleton-like implementation of a ClassLoader -->
<classloader class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
<!-- This section defines several builtin logicsheets. A logicsheet is an XML filter used
to translate user-defined, dynamic markup into equivalent code embedding directives
for a given markup language. -->
<markup-languages>
<xsp-language name="xsp">
<parameter name="prefix" value="xsp"/>
<parameter name="uri" value="http://apache.org/xsp"/>
<!-- Defines the XSP Core logicsheet for the Java language -->
<target-language name="java">
<parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
<!-- The Request logicsheet (taglib) is an XSP logicsheet that wraps XML tags
around standard request operations -->
<builtin-logicsheet>
<parameter name="prefix" value="xsp-request"/>
<parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
</builtin-logicsheet>
<!-- The Response logicsheet (taglib) is an XSP logicsheet that wraps XML tags
around standard response operations -->
<builtin-logicsheet>
<parameter name="prefix" value="xsp-response"/>
<parameter name="uri" value="http://apache.org/xsp/response/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
</builtin-logicsheet>
<!-- The Session logicsheet (taglib) is an XSP logicsheet that wraps XML tags around
standard session operations. Specifically, the Session logicsheet provides an
XML interface to most methods of the HttpSession object (see the Java Servlet API
Specification, version 2.2 ) for more information. -->
<builtin-logicsheet>
<parameter name="prefix" value="session"/>
<parameter name="uri" value="http://apache.org/xsp/session/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/session.xsl"/>
</builtin-logicsheet>
<builtin-logicsheet>
<parameter name="prefix" value="xsp-cookie"/>
<parameter name="uri" value="http://apache.org/xsp/cookie/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/cookie.xsl"/>
</builtin-logicsheet>
<builtin-logicsheet>
<parameter name="prefix" value="log"/>
<parameter name="uri" value="http://apache.org/xsp/log/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/log.xsl"/>
</builtin-logicsheet>
<builtin-logicsheet>
<parameter name="prefix" value="util"/>
<parameter name="uri" value="http://apache.org/xsp/util/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/util.xsl"/>
</builtin-logicsheet>
<!-- The xsp-formval taglib serves as interface to retrieve validation results
from a request attribute -->
<builtin-logicsheet>
<parameter name="prefix" value="xsp-formval"/>
<parameter name="uri" value="http://apache.org/xsp/form-validator/2.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/form-validator.xsl"/>
</builtin-logicsheet>
<!-- The capture taglib is for capturing parts of the XSP-generated XML as
XML fragments or DOM nodes -->
<builtin-logicsheet>
<parameter name="prefix" value="capture"/>
<parameter name="uri" value="http://apache.org/cocoon/capture/1.0"/>
<parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/capture.xsl"/>
</builtin-logicsheet>
</target-language>
</xsp-language>
<!-- Defines Sitemap Core logicsheet for the Java language -->
<sitemap-language name="sitemap">
<parameter name="prefix" value="map"/>
<parameter name="uri" value="http://apache.org/cocoon/sitemap/1.0"/>
<target-language name="java">
<parameter name="core-logicsheet" value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/>
</target-language>
</sitemap-language>
</markup-languages>
<datasources/>
<!-- A StreamPipeline either
collects a Reader and let it produce a character stream
or connects a EventPipeline with a
Serializer and let them produce the character stream.
-->
<stream-pipeline class="org.apache.cocoon.components.pipeline.CachingStreamPipeline"
pool-max="32" pool-min="16" pool-grow="4"/>
<!-- Caching of stream pipeline:
freememory: Indicates how much memory should be left free in the
JVM for normal operation.
heapsize: Indicates how big the heap size can grow to before the
cleanup thread kicks in.
cleanupthreadinterval: Indicates the interval of the cleanup thread in seconds.
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
usecleanupthread: Indicates whether we use a cleanup thread or not.
threadpriority: Indicates the priority of the cleanup thread.
(1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<stream-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
<parameter name="maxobjects" value="100"/>
<parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</stream-cache>
<!-- An EventPipeline connects the generator and the various transformers
and produces a character stream. Alternatives to CachingEventPipeline
is: NonCachingEventPipeline.
<event-pipeline class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/>
-->
<event-pipeline class="org.apache.cocoon.components.pipeline.CachingEventPipeline"
pool-max="32" pool-min="16" pool-grow="4"/>
<!-- Caching of event pipeline:
maxobjects: Indicates how many objects will be hold in the cache.
When the number of maxobjects has been reached. The
last object in the cache will be thrown out.
threadpriority: Indicates the priority of the cleanup thread.
(1 is the lowest priority and 10 is the highest).
filesystem: Turns the filesystem storage for objects on or off.
-->
<event-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
<parameter name="maxobjects" value="100"/>
<parameter name="threadpriority" value="5"/>
<parameter name="filesystem" value="true"/>
</event-cache>
<!-- The SAXConnector connects the various pipeline components.
LoggingSAXConnector logs SAX events between pipeline components
into a cocoon's log file.
Uncomment one of the following lines for using the SAXConnector.
<sax-connector class="org.apache.cocoon.components.saxconnector.LoggingSAXConnector"/>
-->
<!-- ======================== The sitemap ============================== -->
<!-- The reloading of the sitemap:
The check-reload attribute determines if the sitemap is reloaded on change. If
it is set to "no", the sitemap is generated once at startup, if it is set to "yes",
the sitemap is regenerated if it changes.
The reload-method specifies the method for the regeneration:
asynchron: If the sitemap changes, the sitemap is regenerated at the next request in
the background and the incoming request is served with the old sitemap.
All subsequent requests are served with the old sitemap until the
regeneration in the background has finished.
synchron: If the sitemap changes, the sitemap is regenerated at the next request.
When the regeneration is finished the request (and all subsequent ones)
is served with the new sitemap.
For development environment set the reload-method to synchron and the
check-reload to yes, for production environment it is advisable to set
the reload-method to asynchron and for more safety the check-reload to no.
-->
<sitemap file="sitemap.xmap" reload-method="asynchron" check-reload="yes"/>
</cocoon>
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components ================================ -->
<map:components>
<map:generators default="file">
<map:generator name="file" src="org.apache.cocoon.generation.FileGenerator" label="content" pool-max="32" pool-min="16" pool-grow="4"/>
</map:generators>
<map:transformers default="xslt">
<map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer" pool-max="32" pool-min="16" pool-grow="4">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
</map:transformer>
</map:transformers>
<map:readers default="resource"/>
<map:serializers default="html">
<map:serializer name="html" mime-type="text/html" src="org.apache.cocoon.serialization.HTMLSerializer"/>
</map:serializers>
<map:selectors default="browser"/>
<map:matchers default="wildcard">
<map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
<map:matcher name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcherFactory"/>
</map:matchers>
</map:components>
<!-- =========================== Pipelines ================================= -->
<map:pipelines>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="index.html"/>
</map:match>
<map:match pattern="index.html">
<map:generate src="data/datasets.xml"/>
<map:transform src="style/welcome_page.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="*/index.html">
<map:generate src="data/{1}.xml"/>
<map:transform src="style/dataset_page.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match type="regexp" pattern="(.*)/(.*s).html">
<map:generate src="data/{1}.xml"/>
<map:transform src="style/section_page.xsl">
<map:parameter name="section" value="{2}"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
<map:match type="regexp" pattern="(.*)/(.*[0-9]*).html">
<map:generate src="data/{1}.xml"/>
<map:transform src="style/object_page.xsl">
<map:parameter name="object" value="{2}"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
<!-- end of file -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the web-app configurations that allow Cocoon to work under
Apache Tomcat. Please, follow the installation section of the
documentation for more information about installing Cocoon on Tomcat
-->
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>Cocoon2 Demo</display-name>
<description>Demo application for Cocoon2</description>
<servlet>
<servlet-name>Cocoon2</servlet-name>
<display-name>Cocoon2</display-name>
<description>The main Cocoon2 servlet</description>
<!--
In cases you're facing class loader problems you can alternatively
use the following servlet-class instead of the normal one
<servlet-class>org.apache.cocoon.servlet.ParanoidCocoonServlet</servlet-class>
-->
<servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
<!--
This parameter points to the main configuration file for Cocoon.
Note that the path is specified in absolute notation but it will be
resolved relative to the servlets webapp context path
-->
<init-param>
<param-name>configurations</param-name>
<param-value>/cocoon.xconf</param-value>
</init-param>
<!--
This parameter tells cocoon to load all the required libraries into
it's own classloader instead of trusting the Servlet Vendor's
classloader. If you experience strange classloader issues,
try setting this parameter to "true".
-->
<init-param>
<param-name>init-classloader</param-name>
<param-value>false</param-value>
</init-param>
<!--
This parameter indicates the configuration file of the LogKit management
-->
<init-param>
<param-name>logkit-config</param-name>
<param-value>/WEB-INF/logkit.xconf</param-value>
</init-param>
<!--
This parameter indicates the category id of the logger from the LogKit
configuration used by the CocoonServlet.
-->
<init-param>
<param-name>servlet-logger</param-name>
<param-value>root</param-value>
</init-param>
<!--
This parameter indicates the category id of the logger from the LogKit
management configuration for the Cocoon engine.
This logger is used for all components described in the cocoon.xconf
and sitemap.xmap file not having specified a logger with the
logger="..." attribute in the component configuration file.
-->
<init-param>
<param-name>cocoon-logger</param-name>
<param-value>cocoon</param-value>
</init-param>
<!--
This parameter indicates the log level to use throughout startup of the system
Available levels are:
DEBUG: prints all level of log messages.
INFO: prints all level of log messages except DEBUG ones.
WARN: prints all level of log messages except DEBUG and INFO ones.
ERROR: prints all level of log messages except DEBUG, INFO and WARN ones.
FATAL-ERROR: prints only log messages of this level
-->
<init-param>
<param-name>log-level</param-name>
<param-value>DEBUG</param-value>
</init-param>
<!--
Allow reinstantiating (reloading) of the cocoon instance. If this is
set to "yes" or "true", a new cocoon instance can be created using
the request parameter "cocoon-reload".
-->
<init-param>
<param-name>allow-reload</param-name>
<param-value>yes</param-value>
</init-param>
<!--
This parameter allows you to startup Cocoon2 immediately after startup
of your servlet engine.
-->
<load-on-startup>1</load-on-startup>
<!--
If you set this parameter to 'true' or 'yes', Cocoon will add processing
time to the end of each response. Value 'hide' adds processing time as an HTML
comment. By default, processing time is not added (corresponds to value 'no').
-->
<init-param>
<param-name>show-time</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Cocoon2</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>