|
|
Apache Cocoon requires the following systems to be already installed in your system:
Java Virtual Machine
A Java 1.2 or later compatible virtual machine must be present for both
command line and servlet type usage of Apache Cocoon. Note that all servlet engines
require a JVM to run so if you are already using servlets you already have
one installed.
Servlet Engine
A Servlet 2.2 compliant servlet engine must be present in order to support
servlet operation and dynamic request handling. Note that this requirement
is optional for command line operation.
If you don't have a servlet engine installed, well, stop right here and
go to the Apache Tomcat project
http://jakarta.apache.org/tomcat/
then come back when you are done.
|
You have three choices for getting Cocoon: you can either download
a stable relese, or you can download development snapshot, or you can
get the latest development version directly from the cvs repository.
|
 |  |  |
 | Set JAVA_HOME environment variable |  |
 |  |  |
 |  |  |
 | Create the Cocoon WAR package |  |
 |  |  |
|
In most servlet engines, this is just a matter of copying
the war file in a specific directory and the engine will take
care of installing it when restarted.
 | Cocoon requires Tomcat version 3.2 or greater. It wouldn't work
with Tomcat 3.1.X |
Tomcat currently uses a different version of the XML parser
than Cocoon. To get Cocoon to work, you need to perform the
following steps:
-
Stop Tomcat
Go to the tomcat/bin directory, and run the shutdown script.
-
Delete tomcat/lib/jaxp.jar
Tomcat's jaxp.jar is 'sealed', and since xerces contains its
own implementation of the JAXP standard extension, Java
will fail to load xerces and report a 'Package Sealing Violation'
if both are in the classpath.
-
Rename tomcat/lib/parser.jar to tomcat/lib/zparser.jar
Tomcat's parser.jar contains older versions of some the same
XML APIS that Xerces uses, and these will prevent Xerces from
functioning properly if they appear before Xerces in the classpath.
Since Tomcat's startup scripts automatically load all the jar files
in tomcat/lib in name order, changing the name of the file causes it
to be loaded last in the classpath.
-
Copy the cocoon/lib/xerces-XXX.jar and cocoon/lib/xml-apis.jar files to tomcat/lib
Cocoon will now be able to see and use the correct XML libraries.
-
Copy cocoon/build/cocoon/cocoon.war into tomcat/webapps
-
Start Tomcat
Go to the tomcat/bin directory, and run the startup script.
-
Start using Cocoon
Access the URI
http://localhost:8080/cocoon/
with your favorite browser and start to enjoy the world of Cocoon.
Note that the first time you access Cocoon, it will take a few
seconds to start, since Cocoon needs to compile parts of itself.
|
Tomcat 4 is a really straight-forward installation.
-
Build the Cocoon webapp
Build the webapp as described above.
-
Copy cocoon/build/cocoon/cocoon.war into tomcat/webapps
-
Start Tomcat
Go to the tomcat/bin directory, and run the startup script.
-
Start using Cocoon
Access the URI
http://localhost:8080/cocoon/
with your favorite browser and start to enjoy the world of Cocoon.
Note that the first time you access Cocoon, it will take a few
seconds to start, since Cocoon needs to compile parts of itself.
|
 |  |  |
 | Installing on BEA WLS6.1sp1, WLS6.1sp2 |  |
 |  |  |
This section describes installing Cocoon in a "directory configuration".
This was successfully installed under Windows 2000.
Unix users will need to adjust appropriately. If you haven't done so already,
build a domain and a server. In this discussion, the name of the domain
is 'mydomain' and the name of the server is 'myserver'.
These are the BEA default names; you may want to download
WLS6.1.
- Compile and build Cocoon. Launch
build compile ,
build -Dinclude.webapp.libs webapp webapp-local .
- You should have a webapplication directory in
{cocoon-dir}/build/cocoon/webapp .
- Modify
{cocoon-dir}/build/cocoon/webapp/cocoon.xconf .
Replace xslt-processor definition using TRAX XSLT transformer factory by
xslt-processor definition using Xalan transformer factory explicitly.
Your xslt-processor definition should look like the code snippet below.
-
Configure your WebLogic server, launch your WebLogic console.
Use
Configure a new Web Application... ,
and enter in field "Path URI" full path name of Cocoon
webapplication directory,
like d:\xml-cocoon2\build\cocoon\webapp ,
enter in field "Name" the servlet name
eg. cocoon .
Check the "Deployed" checkbox, and click "Apply".
At last be sure that you assign the servlet to a target server.
-
You might try to avoid the configuration step by copying
the whole Cocoon webapp directory into the
applications
directory of your WLS6.1 server. In this case you might have
to restart your WLS6.1 server in order to activate Cococoon servlet in WLS 6.1.
-
Using a browser, you might want to check WLS6.1 configuration
link to your WLS6.1 console
http://<your machine name>:<port number>/console.
-
Using a browser, link to your web site's cocoon page:
http://<your machine name>:<port number>/cocoon/
(Don't forget the final / in the link.)
-
Congratulations! (hopefully) you should see the Cocoon welcome page.
Snippet of modified cocoon.xconf . The effect of this
change is that Cocoon will not try to use a TRAX XSLT transformer factory.
Using the TRAX XSLT transformer factory under WLS6.1sp1 lead to empty
sitemap_xmap.java files, indicating that the XSLT processor
used did not work properly. WLS6.1 has a built-in TRAX XSLT which seems
not to work properly for Cocoon.
The code snippet below configures the xslt processor to use the XALAN transformer
factory explictly.
Forcing Cocoon using Xalan XSLT lead to correct sitemap_xmap.java
files.
 |  |  |
 |
<xslt-processor class="org.apache.cocoon.components.xslt.XSLTProcessorImpl"
logger="root.xslt">
<parameter name="use-store" value="true"/>
<parameter name="transformer-factory"
value="org.apache.xalan.processor.TransformerFactoryImpl"/>
</xslt-processor>
|  |
 |  |  |
 |
The above description does not change any WLS6.1 startup script. Moreover
other applications will still use the WLS6.1 shipped XSLT processor.
All changes described above are locally to the Cocoon webapplication.
|
|
 |  |  |
 | Installing on JBoss 2.2.2 with Tomcat 3.2.2 |  |
 |  |  |
 |  |  |
 | Installing on Resin 2.0.x |  |
 |  |  |
HP-AS is J2EE application server available from the Hewlett-Packard website.
Download and install HP-AS 8.X
 | Cocoon cannot be deployed as a .war file in HP-AS.
Use the following steps to deploy cocoon.war:
|
- Extract the
cocoon.war file to some directory, using WinZIP
or a similar utility to extract the files.
- To run HP-AS, go to
( Start | Programs | HP Middleware | HP Application Server | System Console).
The HP-AS Console appears with a Log browser.
As the HP-AS kernel starts and initializes, messages will appear in the
status bar of the console.
Wait for the message 'Kernel started' to appear in the Log browser.
The following message should display:
[10/16/01 16:03:50][localhost_][S]:Kernel "kernel" started.
- To verify that an instance of HP-AS is running,
open a web browser and go to
:http://localhost:9090/helloservlet/hello.
An HTML page should appear containing the following message:
Congratulations!
Congratulations from the HelloWorldServlet
It appears you have the server running
My servlet path is /hello
This test is valid only if you've performed a full install of HP-AS
- In the HP-AS console, select View | Deployment Window.
In the Available Files pane on the right,
browse to the the directory you extracted the
cocoon.war file to.
Expand this directory, and then drag and drop the
cocoon sub-directory node to the kernel.j2ee-partition icon
in the left pane.
- When prompted, answer Yes to the deployment question.
This should create an appropriate entry in the HP-AS j2ee partition configuration file.
In the current version of the console,
there is no indication that the operation succeeded.
If you see a parser error in the Log browser, ignore it.
- To test the deployment, open a web browser and go to the following URL:
http://localhost:9090/cocoon/welcome
Congratulations! (hopefully) you should see the Cocoon welcome page.
(this request may take some time).
|
|
|
|