apache > cocoon

- Home

# Cocoon Configuration FAQs

##

## How do I setup my own .roles file?

In cocoon.xconf you can specify your my.roles file as follows:

       ...
       <cocoon version="2.0" user-roles="/WEB-INF/my.roles">
       ...

if you are using Tomcat 4. For other versions, skip the leading slash of the URI.

And create a new file my.roles in WEB-INF directory with

    <?xml version="1.0"?>
    <role-list>
      <role name="org.apache.cocoon.components.jsp.JSPEngine"
            shorthand="jsp-engine"
            default-class="org.apache.cocoon.components.jsp.JSPEngineImplWLS"/>
    </role-list>

## Where do I setup LogKit in Cocoon?

1. `{cocoon}/WEB-INF/logkit.xconf`:

Please refer to the Avalon LogKit Documentation

2. `{cocoon}/WEB-INF/web.xml`:

Here you can change following paramters:

- `logkit-config`: This parameter indicates the configuration file of the LogKit management
- `servlet-logger`: This parameter indicates the category id of the logger from the LogKit configuration used by the CocoonServlet.
- `cocoon-logger`: 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.
- `log-level`: This parameter indicates the log level to use throughout startup of the system. As soon as the logkit.xconf the setting of the logkit.xconf configuration is used instead! Only for startup and if the logkit.xconf is not readable/available this log level is of importance.

Note
See inline comments in these files for further information!

Learn more about LogKit configuration by downloading the free chapter, A User's Look at the Cocoon architecture, from Langham and Ziegeler's Cocoon: Building XML Applications available at the New Riders web site.

## How can I change the physical location of my upload directory?

Look in web.xml file located in <your-webapp>/WEB-INF. There you will find the following snippet:

        <init-param>
          <param-name>upload-directory</param-name>
          <param-value>/WEB-INF/work/upload-dir</param-value>
        </init-param>

The above snippet shows the default path to the upload directory, specified within <param-value>. Replace it with a different path to your upload directory, relative to the context path of the servlet.

## How can I solve 'Too many open files' errors when I try to create a search index for my site?

Either reduce the number of tags in your documant, by filtering it with xslt in your search view.

Or, increase the limit on the number of files your opperating system allows you to have open simultaneously, in the shell you launch the servlet engine in.

example (Linux, bash shell): ulimit 2048

example (MacOSX, tcsh shell): limit descriptors 2048

Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version (registration required).