http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Index
License
Install

Technologies
Infrastructure
User Guide
Dynamic Content

XSP Processor
DCP Processor
SQL Processor
LDAP Processor

XSP WD

Javadocs

Cocoon 2
Javadoc XML

FAQ
Changes
Todo

Mail Archive
Bug Database


Questions

Answers
I can't get XSP to work. What might be wrong?

The XSP processor requires a single configuration that might cause problems: the repository location for compiled server pages.

processor.xsp.repository = ./repository

If the process that runs the servlet engine doesn't have both reading and writing persmissions on that directory, the XSP processor won't work, so make sure you locate that directory to a safe place.

NoteWarning: Since this directory may contain security sensible information, make sure you deny access (even read-only) to untrusted users.

Another common problem is the system complaining about missing classes such as:

java.lang.NoClassDefFoundError: sun/tools/javac/Main

If this happens, make sure you have installed the tools.jar package you find in [jdk_home]/lib/tools.jar.


Why the LDAP processor doesn't work?

Make sure you have the Sun JNDI API package installed in your classpath.


Why DCP doesn't work with EcmaScript anymore? Where do I find the class FESI/jslib/JSObject?

Since Cocoon now ships with all the required packages and Fesi is a very big package, we decided to make Ecmascript support for DCP optional.

So, you should turn on the language interpretation in the cocoon configurations and place the FESI package in your classpath.

Notethe DCP processor should be considered deprecated and we do not guarantee that will be supported in future versions. We highly suggest you to transfor all of your DCP pages into XSP pages.


How come Apache is not redirecting requests to Cocoon?

There is a bug in mod_jserv that makes it dependent on its configuration position. If you use ApJServHandler you should change this to more standard Action and AddHandler. If you installed an old version of Cocoon, read again the installation instructions to find a solutions for this problem. (thanks to Dan Egnor for finding and solving the problem).


How do I pipe my servlet output into Cocoon?

Simple answer: you don't!!! read to find out equivalent ways to do what you need.

Complex answer: the Servlet API was not designed with servlet chaining capabilities in mind. Servlet chaining was a night hack of the original Java web server authors that allowed to pipe one servlet output into the request of another. Currently (version 2.2) the Servlet API spec doesn't allow a servlet to post-process the output of another servlet, so, since Cocoon is a servlet, there is no portable way for it to call your servlet and to process its output.

The Cocoon Project is in close contact with the Servlet API Expert Group at Sun (being Stefano Mazzocchi a member of that board) and will propose post-processing hooks for inclusion in the next Servlet API specifications. Since this is work in progress, please, don't fill up the mail list with questions about this: Cocoon will reflect the API changes as soon as they are publicly available.


Where do I get more information on XSL and XML?

The web community is very exited about XML and XSL and many sources of information are coming up even if these languages are fairly new. Here is a list of locations you might be interested in to continue to gather resources on this state-of-the-art technology


Are there document translations to other languages?

Given the problems we already have with documentation (which is never big and good enough), the Cocoon Project uses English as its standard and only documentation language. This is also the only language used in the mail lists. Also, the Cocoon distribution will contain English documentation only to reduce updating problems.

On the other hand, we welcome any effort that provides document translations and we will keep here links to those translated documents.

NoteThe Cocoon Project is not directly involved in these translating efforts and we are not resposible for any lack of synch between the official Cocoon documentation and the translated version. For this reason, do not contact the Cocoon Project but directly the people that provide the translation. Thank you.


Why do I keep getting FileNotFoundException under Tomcat 3.0?

See question below


How come Cocoon doesn't work on Tomcat 3.0?

You must apply this patch to Tomcat 3.0 and recompile it or it won't work. This patch is already present in latest CVS code but in case you don't want to download the latest code you can apply this:

 Index: RequestMapper.java
   ===================================================================
   RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestMapper.java,v

   retrieving revision 1.5
   retrieving revision 1.6
   diff -u -r1.5 -r1.6
   --- RequestMapper.java 1999/11/05 18:36:33  1.5
   +++ RequestMapper.java 1999/12/17 18:59:14  1.6
   @@ -285,13 +285,7 @@
                mapPath = "/" + s;
            } else if (mapPath == null &&
                this.resourceName != null) {
   -            // XXX
   -            // hack to differentiate amongst a mapped servlet and a jsp
   -      if (! wrapper.getServletClass().equals(Constants.JSP.CLASSNAME)) {
   -                mapPath = "/" + wrapper.getServletClass();
   -            } else {
   -                mapPath = this.resourceName;
   -            }
   +            mapPath = this.resourceName;
            }

            return mapPath;

Are external entities still broken?

No, external entity support has been fixed for both absolute and relative URIs. Note that ProjectX and Xerces behave differently on these but this is not something we are in control of.


I see that Cocon 1.x has starting to incorporate features planned for Cocoon 2.x, why?

We believe that smooth project evolution is much better than step-wise revolutionary paths. For this reason, we'll try hard to incorporate all the Cocoon2 features in the main project thus limiting the porting effort for you over time.

Note that this doesn't mean that Cocoon won't change in the future and we state clearly that we do care about back compatibility but only when this is not limiting the evolution of he platform too much.

For this reason, while the DOM->SAX evolution might be totally painless, the sitemap proposal will completely change the Cocoon configurations. Anyway, Cocoon has a long way to go and if it changes during its evolution to a final state, don't complain: you have been warned.

However, we DO consider and value the time you invested in Cocoon so we'll do our best to make sure that unneeded back incompatibilities don't get included.


The XSL book I read says the correct way of indicating the XSL stylesheet is by using the XML processing instruction <?xml:stylesheet?> while Cocoon is using <?xml-stylesheet?>. Who is right?

The PI <?xml:stylesheet type="text/xsl" href=""?> is the old method of associating a stylesheet with an XML document. Unfortunately, this technology is rapidly changing and your books should warn you that the topic they are discussing is not even in W3C Recommendation state. Which means that more changes are on their way.

The current and proper way to associate a stylesheet with an XML document can be found at http://www.w3.org/TR/xml-stylesheet and clearly indicates that <?xml-stylesheet ...?> is the proper way.


I think that using Processing Instructions to "chain" document layers somehow violates the context separation since I would like to be able to place style sensible information in sessions or request parameters. What do you think about this?

You are right, PI reaction breaks the context separation and it's, at the very end, the wrong approach. To follow a complete "model, view, controller" design pattern, one should be able to associate a different processing chain for each requested URI and for every possible request state (with request parameters, session parameters and environment parameters).

The proposed solution (as you read in the ) is to have a site map where site managers decide what processing chain to apply to each possible request. This somehow follows the mod_rewrite model in the Apache Web Server, but rather than URL rewriting, the site map allows site designers to control the behavior of their documents in one place without having to modify every single reactive PI in each source file.

So, you've been warned: the PIs will go away, current functionality will remain but the processing management will be abstracted one layer up.


What is WAP and how do I browse WML?

WAP stands for Wireless Application Protocol and WML stands for Wireless Markup Language. For more information about these two, please refer to the WAP Forum. For a client able to browse WML 1.1, Cocoon has been tested with the Nokia WAP Toolkit which emulates a Nokia WAP cell phone on your desktop.


What is VoxML and how do I browse VML?

VoxML is a voice markup language, designed to allow direct integration between voice recognition/synthesis software and web technologies. The Cocoon VML samples have been tested with the Motorola VoxML SDK 1.1(for windows) which is freely available.


Why is my Internet Explorer not showing PDF or VRML samples?

This is a long-time problem with internet explorer which, illegally, reacts on URI extention rathen than returned MIME type. The only think you can do for now is to map .pdf or .wrl to Cocoon for handling, but we know that sucks. Don't worry, in the future, the sitemap proposal will allow you to work around this magically. For now, just don't use IE :)


When I compile Cocoon on my system, I get all a bunch of errors. What's wrong?

You probably didn't add all the needed packages to your compiler's classpath. Note that Cocoon supports much more packages than you normally use and you should have them all to compile the full source code (this is why the cocoon.jar is distributed). To avoid this, simply remove (or rename) the classes that wrap around the packages you don't use.

Note that if you tried to compile Cocoon.java alone, many classes are not compiled because there is no hardcoded reference to them. Cocoon uses dynamic loading based on its property file to get the modules it needs when started. For this reason, the compiler is not able to tell which class will be use and its dependency checks are never complete. The only way to compile it is to manually indicate all the files to compile or to use the makefiles after removing the unwanted wrapper classes for the packages you don't have or you don't want.

Note that Cocoon is built using Ant: please, refer to the build.xml file for more information on how to set up your system to compile Cocoon


Why the name "Cocoon"?

(Cocoon's creator Stefano Mazzocchi answers): It's a pretty stupid reason and a funny story: I spent my 1998 Xmas vacation with my girlfriend up on the Alps at her cottage. One night I couldn't sleep, I went to watch some TV and finishing reading the XSL documentation I brought with me. Being a science fiction afficionado, I found out that Ron Howard's movie Cocoon was on and I started watching it. The idea of the XSL rendering servlet stoke me like the alien "cocoons" in the pool stroke those old men in the movie and, while watching, I started paper-coding it right away. After a while the movie was over and the publishing framework designed. The name "Cocoon" seemed right for the thing, meaning to be a way to bring new life to old ideas as well as to create cocoons for such new ideas to become beautiful butterflies. :-)




Copyright © 1999-2000 The Apache Software Foundation. All Rights Reserved.