abhijeet, rai

Greenhorn
+ Follow
since Sep 05, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by abhijeet, rai

Hi
Has anybody found the solution for this problem.if yes pls post it on this site.
thanks
abhijeet

Originally posted by Mary, Cole:
Hi,

I am setting up cocoon on Tomcat server.I followed the instructions given in the java and XMl book in chapter 9 in setting up the web.xml file of Tomcat

I am unable to run the cocoom.xml file.what is the equivalent of the bold setting below on windows environment.
I should give the full path like d:\jakarta-tomcat/conf/cocoon.properties or should i give it as /jakarta-tomcat/conf/cocoon.properties



<servlet>
<servlet-name>
org.apache.cocoon.Cocoon
</servlet-name>
<servlet-class>
org.apache.cocoon.Cocoon
</servlet-class>
<init-param>
<param-name>
properties
</param-name>
<param-value>
/usr/lib/jakarta-tomcat/conf/cocoon.properties
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>
org.apache.cocoon.Cocoon
</servlet-name>
<url-pattern>
*.xml
</url-pattern>
</servlet-mapping>


Pl reply


Hi Mary,
The problem here is it is trying to find physical location of /Cocoon.xml under jakarta-tomcat-3.2.3/webapps/ROOT so you need to place Cocoon.xml under the ROOT directory.then it will work.
had a same problem
thanks
abhijeet
=================================================================
Configuring the Servlet Engine
Once you have built Cocoon, you need to configure your servlet engine to use Cocoon and tell it which requests Cocoon should handle. We look at setting up Cocoon to work with the Jakarta Tomcat servlet engine here;[3] as this is the reference implementation for the Java Servlet API 2.2, you should be able to mimic these steps for your own servlet engine if you are not using the Tomcat implementation.
The Cocoon framework is built to operate at an engine level rather than as another servlet in your engine. Therefore, we need to add Cocoon and its dependencies to the core servlet engine class path rather than in a particular servlet zone or context. Copy the Cocoon jar file and the Xerces, Xalan, and FOP jar files into the Tomcat lib/ subdirectory, off of the main Tomcat installation directory. You then need to add these libraries to the engine class path; in Tomcat, this is accomplished through editing the Tomcat initialization script. For Windows platforms, this is <TOMCAT_HOME>/bin/tomcat.bat ; for Unix platforms, <TOMCAT_HOME>/bin/tomcat.sh. In these files, you will see the lines that set the class path used by Tomcat when starting up. You should add the Cocoon distribution and its dependencies before these other entries in the configuration file. On Windows, this will look like:
set CLASSPATH=.
set CLASSPATH=%TOMCAT_HOME%\classes

rem Cocoon classes and libraries
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xerces_1_0_3.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xalan_1_0_0.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar

set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
On Unix platforms, the modified file should look like this:
CLASSPATH=.

# Cocoon classes and libraries
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xerces_1_0_3.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xalan_0_20_0.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/fop_0_12_1.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/cocoon.jar

for i in ${TOMCAT_HOME}/lib/* ; do
CLASSPATH=${CLASSPATH}:$i
done

CLASSPATH=${CLASSPATH}:${JAVA_HOME}/lib/tools.jar
==============================================================

Everything is working fine till here.
==============================================================

It is important to ensure that the Cocoon classes precede the rest of the Tomcat classes, particularly xml.jar. While Xerces, Xalan, and Cocoon all use SAX 2 and DOM Level 2 classes and interfaces, the Sun Project X parser contained in xml.jar does not yet have SAX 2 and DOM Level 2 support; if this class and its SAX and DOM versions are found first, the Cocoon framework will error out.
With these libraries added, all that is left is to specify to Cocoon the location of its properties file (we will look at what this file does a little later). Copy the cocoon.properties file from the Cocoon root directory into <TOMCAT_HOME>/conf/. In this same directory, you will see web.xml, which configures the properties for engine-wide servlets. In this file are properties and mappings for various engine-level servlets; we need to add configuration for Cocoon here. Insert the following entries into the engine configuration file:
<servlet>
<servlet-name>
org.apache.cocoon.Cocoon
</servlet-name>
<servlet-class>
org.apache.cocoon.Cocoon
</servlet-class>
<init-param>
<param-name>
properties
</param-name>
<param-value>
/usr/lib/jakarta-tomcat/conf/cocoon.properties
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>
org.apache.cocoon.Cocoon
</servlet-name>
<url-pattern>
*.xml
</url-pattern>
</servlet-mapping>
The location within the file does not matter, as long as you ensure that element nestings are not disrupted; in other words, the resulting file must remain well-formed XML. You will also need to insert the correct path to the cocoon.properties file for the value of the properties parameter. This tells the engine to pass this parameter to the main Cocoon servlet, enabling it to configure itself and the rest of the Cocoon framework. The servlet-mapping then instructs the engine to direct all URI requests that end in .xml to the Cocoon framework. With these changes made, you can start (or restart) Tomcat; ensure that no errors occur and the Cocoon install can be tested.
If everything has been configured correctly, you should be able to access http://<hostname>:<port>/Cocoon.xml in your web browser. If no errors occur, the HTML output should look like that shown in Figure 9-1.
=================================================================
So when I am accessing http://<hostname>:<port>/Cocoon.xml , its not working .Its giving 404 error.I think am wrong in setting the below thing in web.xml file.

<param-value>
/usr/lib/jakarta-tomcat/conf/cocoon.properties
</param-value>

Hope you got it now.Satya pl reply fast as I have a tight schedule.If you could give me your E-mail id that would be great too.
Thanx[/B]