You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anthony Kalm <ak...@uen.org> on 2000/05/22 23:28:38 UTC

Still having problems with Cocoon and Tomcat

In order to provide the reader(s) with more information on my problem I
have written down my installation procedures as well as the error(s) I
am getting.  This may seem like a long winded message but I am stumped.
I've browsed the FAQ's and documentation.  I've found several
conflicting opinions on this so if anyone can help PLEASE let me know.

Thanks,
Anthony

So here goes:

First the error(s):

Cocoon 1.7.3
Publishing Engine could not be initialized.
java.lang.NullPointerException
at org.apache.cocoon.Cocoon.init(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.initServlet(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Compiled
Code)
at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)

                          Warning: this page has been dynamically
generated.


Now the steps I followed in order to configure the servers:

#How to compile Apache with DSO

./configure --with-layout=Apache --prefix=/home/akalm/XML/apache_1.3.12
--enable-module=so $@

make

make install

in httpd.conf:
set User to akalm
set Group to develgrp
=================================================================

#How to compile Tomcat

First, you must have the jakarta-ant workspace checked out parallel
to this workspace (jakarta-tomcat). Without jakarta-ant, you won't
be able to build.  When you have completed your downloads and checkouts,

you should have the following directory structure:

 $JAKARTA_HOME/
  jakarta-ant/    <-- Contains jakarta-ant files
  jakarta-tomcat/ <-- Contains jakarta-tomcat files

To build, execute the following command in the jakarta-tomcat directory:

 build.sh  <-- Unix

This will build Tomcat into ../build/tomcat.

If you are running under JDK 1.2, you will need to ensure that the
"tools.jar" file from your JDK distribution is present on your
classpath.
The Java compiler is required by the JSP engine, which uses it when
converting JSP source files into Java class files.

Two scripts are provided for starting and stopping the server. To
start the server:

 cd ../build/tomcat <-- Unix
 bin/startup.sh


======================================================================

#Building mod_jserv

cd /home/akalm/XML/jakarta-tomcat/src/native/apache/jserv

/home/akalm/XML/apache_1.3.12/bin/apxs -c *.c -o mod_jserv.so

cp autochange.so /home/akalm/XML/apache_1.3.12/libexec/

cd /home/akalm/XML/apache_1.3.12/libexec/

mv autochange.so mod_jserv.so

======================================================================

#Including the tomcat.conf or tomcat-apache.conf files in the Apache
httpd.conf file

#Near the end of the document types section in httpd.conf add the
following.

AddType text/xml .xml
AddHandler jserv-servlet .xml

at the end of the Apache httpd.conf file type in the following:

include /home/akalm/XML/build/tomcat/conf/tomcat.conf

======================================================================

#Building Cocoon

untar file, in main directory ./build.sh

that's it.

#Configuring Tomcat to work with Cocoon

cp cocoon.jar /home/akalm/XML/build/tomcat/lib

cp xerces_1_0_3.jar xalan_1_0_1.jar fop_0_12_1.jar
/home/akalm/XML/build/tomcat/lib/

cd /home/akalm/XML/build/tomcat/bin/

in the tomcat.sh scrip add the following after CLASSPATH=.

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

##############################################################
# OK here's a sticking point, several people disagree on this one so I'm
still working on it.

cp /home/akalm/XML/cocoon-1.7.3/conf/cocoon.properties  to
/home/akalm/XML/build/tomcat/conf

#This is where you specify the location of the cocoon.properties file.

#Now edit the web.xml file in the /home/akalm/XML/build/tomcat/conf
directory to include the following:

<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>
     /home/akalm/XML/build/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>



Odp: Still having problems with Cocoon and Tomcat

Posted by Aleksander Grzebyta <ol...@talex.com.pl>.
This path should be relative to context the servlet is within:


>      /home/akalm/XML/build/tomcat/conf/cocoon.properties

See my other postst abou Cocoon lately.

sincerely Olek


Re: Still having problems with Cocoon and Tomcat

Posted by Anthony Kalm <ak...@uen.org>.
Morten YOU'RE A GENIUS!!!!!!!!!!!!!!!!!

I did follow ch09.html and it's pretty good but the information you provided below helps
to correct the information which, I assume, is out of date or simply wrong.  The
information you so kindly provided below is the correct information.  I can now sleep
peacefully tonight.  Thank you!


Morten Primdahl wrote:

> Install Cocoon under Tomcat as described here:
>
> http://www.oreilly.com/catalog/javaxml/chapter/ch09.html
>
> Some packages might have changed version number, do so
> accordingly in your config files. Then locate the
> cocoon.properties and copy it to
>
>   $TOMCAT_HOME/webapps/ROOT/WEB-INF
>
> in your $TOMCAT_HOME/conf dir, use
>
> <param-value>
>    WEB-INF/cocoon.properties
> </param-value>
>
> in the web.xml config file. Important, it's relative to the document
> root. Don't know whether chapter 9 has been modified to
> reflect this. But follow the above and it will work.
>
> Morten
>
> On Mon, 22 May 2000, Anthony Kalm wrote:
>
> > In order to provide the reader(s) with more information on my problem I
> > have written down my installation procedures as well as the error(s) I
> > am getting.  This may seem like a long winded message but I am stumped.
> > I've browsed the FAQ's and documentation.  I've found several
> > conflicting opinions on this so if anyone can help PLEASE let me know.
> >
> > Thanks,
> > Anthony
> >
> > So here goes:
> >
> > First the error(s):
> >
> > Cocoon 1.7.3
> > Publishing Engine could not be initialized.
> > java.lang.NullPointerException
> > at org.apache.cocoon.Cocoon.init(Compiled Code)
> > at org.apache.tomcat.core.ServletWrapper.initServlet(Compiled Code)
> > at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
> > at org.apache.tomcat.core.ContextManager.service(Compiled Code)
> > at
> > org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Compiled
> > Code)
> > at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
> > at java.lang.Thread.run(Compiled Code)
> >
> >                           Warning: this page has been dynamically
> > generated.
> >
> >
> > Now the steps I followed in order to configure the servers:
> >
> > #How to compile Apache with DSO
> >
> > ./configure --with-layout=Apache --prefix=/home/akalm/XML/apache_1.3.12
> > --enable-module=so $@
> >
> > make
> >
> > make install
> >
> > in httpd.conf:
> > set User to akalm
> > set Group to develgrp
> > =================================================================
> >
> > #How to compile Tomcat
> >
> > First, you must have the jakarta-ant workspace checked out parallel
> > to this workspace (jakarta-tomcat). Without jakarta-ant, you won't
> > be able to build.  When you have completed your downloads and checkouts,
> >
> > you should have the following directory structure:
> >
> >  $JAKARTA_HOME/
> >   jakarta-ant/    <-- Contains jakarta-ant files
> >   jakarta-tomcat/ <-- Contains jakarta-tomcat files
> >
> > To build, execute the following command in the jakarta-tomcat directory:
> >
> >  build.sh  <-- Unix
> >
> > This will build Tomcat into ../build/tomcat.
> >
> > If you are running under JDK 1.2, you will need to ensure that the
> > "tools.jar" file from your JDK distribution is present on your
> > classpath.
> > The Java compiler is required by the JSP engine, which uses it when
> > converting JSP source files into Java class files.
> >
> > Two scripts are provided for starting and stopping the server. To
> > start the server:
> >
> >  cd ../build/tomcat <-- Unix
> >  bin/startup.sh
> >
> >
> > ======================================================================
> >
> > #Building mod_jserv
> >
> > cd /home/akalm/XML/jakarta-tomcat/src/native/apache/jserv
> >
> > /home/akalm/XML/apache_1.3.12/bin/apxs -c *.c -o mod_jserv.so
> >
> > cp autochange.so /home/akalm/XML/apache_1.3.12/libexec/
> >
> > cd /home/akalm/XML/apache_1.3.12/libexec/
> >
> > mv autochange.so mod_jserv.so
> >
> > ======================================================================
> >
> > #Including the tomcat.conf or tomcat-apache.conf files in the Apache
> > httpd.conf file
> >
> > #Near the end of the document types section in httpd.conf add the
> > following.
> >
> > AddType text/xml .xml
> > AddHandler jserv-servlet .xml
> >
> > at the end of the Apache httpd.conf file type in the following:
> >
> > include /home/akalm/XML/build/tomcat/conf/tomcat.conf
> >
> > ======================================================================
> >
> > #Building Cocoon
> >
> > untar file, in main directory ./build.sh
> >
> > that's it.
> >
> > #Configuring Tomcat to work with Cocoon
> >
> > cp cocoon.jar /home/akalm/XML/build/tomcat/lib
> >
> > cp xerces_1_0_3.jar xalan_1_0_1.jar fop_0_12_1.jar
> > /home/akalm/XML/build/tomcat/lib/
> >
> > cd /home/akalm/XML/build/tomcat/bin/
> >
> > in the tomcat.sh scrip add the following after CLASSPATH=.
> >
> > #Cocoon classes and libraries.
> > CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xerces_1_0_3.jar
> > CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xalan_1_0_1.jar
> > CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/fop_0_12_1.jar
> > CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/cocoon.jar
> >
> > ##############################################################
> > # OK here's a sticking point, several people disagree on this one so I'm
> > still working on it.
> >
> > cp /home/akalm/XML/cocoon-1.7.3/conf/cocoon.properties  to
> > /home/akalm/XML/build/tomcat/conf
> >
> > #This is where you specify the location of the cocoon.properties file.
> >
> > #Now edit the web.xml file in the /home/akalm/XML/build/tomcat/conf
> > directory to include the following:
> >
> > <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>
> >      /home/akalm/XML/build/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>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Still having problems with Cocoon and Tomcat

Posted by Morten Primdahl <mo...@caput.com>.
Install Cocoon under Tomcat as described here:

http://www.oreilly.com/catalog/javaxml/chapter/ch09.html

Some packages might have changed version number, do so
accordingly in your config files. Then locate the
cocoon.properties and copy it to 

  $TOMCAT_HOME/webapps/ROOT/WEB-INF

in your $TOMCAT_HOME/conf dir, use

<param-value>
   WEB-INF/cocoon.properties
</param-value>

in the web.xml config file. Important, it's relative to the document
root. Don't know whether chapter 9 has been modified to
reflect this. But follow the above and it will work.

Morten

On Mon, 22 May 2000, Anthony Kalm wrote:

> In order to provide the reader(s) with more information on my problem I
> have written down my installation procedures as well as the error(s) I
> am getting.  This may seem like a long winded message but I am stumped.
> I've browsed the FAQ's and documentation.  I've found several
> conflicting opinions on this so if anyone can help PLEASE let me know.
> 
> Thanks,
> Anthony
> 
> So here goes:
> 
> First the error(s):
> 
> Cocoon 1.7.3
> Publishing Engine could not be initialized.
> java.lang.NullPointerException
> at org.apache.cocoon.Cocoon.init(Compiled Code)
> at org.apache.tomcat.core.ServletWrapper.initServlet(Compiled Code)
> at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
> at org.apache.tomcat.core.ContextManager.service(Compiled Code)
> at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Compiled
> Code)
> at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
> at java.lang.Thread.run(Compiled Code)
> 
>                           Warning: this page has been dynamically
> generated.
> 
> 
> Now the steps I followed in order to configure the servers:
> 
> #How to compile Apache with DSO
> 
> ./configure --with-layout=Apache --prefix=/home/akalm/XML/apache_1.3.12
> --enable-module=so $@
> 
> make
> 
> make install
> 
> in httpd.conf:
> set User to akalm
> set Group to develgrp
> =================================================================
> 
> #How to compile Tomcat
> 
> First, you must have the jakarta-ant workspace checked out parallel
> to this workspace (jakarta-tomcat). Without jakarta-ant, you won't
> be able to build.  When you have completed your downloads and checkouts,
> 
> you should have the following directory structure:
> 
>  $JAKARTA_HOME/
>   jakarta-ant/    <-- Contains jakarta-ant files
>   jakarta-tomcat/ <-- Contains jakarta-tomcat files
> 
> To build, execute the following command in the jakarta-tomcat directory:
> 
>  build.sh  <-- Unix
> 
> This will build Tomcat into ../build/tomcat.
> 
> If you are running under JDK 1.2, you will need to ensure that the
> "tools.jar" file from your JDK distribution is present on your
> classpath.
> The Java compiler is required by the JSP engine, which uses it when
> converting JSP source files into Java class files.
> 
> Two scripts are provided for starting and stopping the server. To
> start the server:
> 
>  cd ../build/tomcat <-- Unix
>  bin/startup.sh
> 
> 
> ======================================================================
> 
> #Building mod_jserv
> 
> cd /home/akalm/XML/jakarta-tomcat/src/native/apache/jserv
> 
> /home/akalm/XML/apache_1.3.12/bin/apxs -c *.c -o mod_jserv.so
> 
> cp autochange.so /home/akalm/XML/apache_1.3.12/libexec/
> 
> cd /home/akalm/XML/apache_1.3.12/libexec/
> 
> mv autochange.so mod_jserv.so
> 
> ======================================================================
> 
> #Including the tomcat.conf or tomcat-apache.conf files in the Apache
> httpd.conf file
> 
> #Near the end of the document types section in httpd.conf add the
> following.
> 
> AddType text/xml .xml
> AddHandler jserv-servlet .xml
> 
> at the end of the Apache httpd.conf file type in the following:
> 
> include /home/akalm/XML/build/tomcat/conf/tomcat.conf
> 
> ======================================================================
> 
> #Building Cocoon
> 
> untar file, in main directory ./build.sh
> 
> that's it.
> 
> #Configuring Tomcat to work with Cocoon
> 
> cp cocoon.jar /home/akalm/XML/build/tomcat/lib
> 
> cp xerces_1_0_3.jar xalan_1_0_1.jar fop_0_12_1.jar
> /home/akalm/XML/build/tomcat/lib/
> 
> cd /home/akalm/XML/build/tomcat/bin/
> 
> in the tomcat.sh scrip add the following after CLASSPATH=.
> 
> #Cocoon classes and libraries.
> CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xerces_1_0_3.jar
> CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xalan_1_0_1.jar
> CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/fop_0_12_1.jar
> CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/cocoon.jar
> 
> ##############################################################
> # OK here's a sticking point, several people disagree on this one so I'm
> still working on it.
> 
> cp /home/akalm/XML/cocoon-1.7.3/conf/cocoon.properties  to
> /home/akalm/XML/build/tomcat/conf
> 
> #This is where you specify the location of the cocoon.properties file.
> 
> #Now edit the web.xml file in the /home/akalm/XML/build/tomcat/conf
> directory to include the following:
> 
> <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>
>      /home/akalm/XML/build/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>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>