jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Brunson <charles.brun...@sun.com>
Subject Re: Problem getting the samples (Cactus 1.3) to run in Orion 1.5.4
Date Thu, 02 May 2002 17:47:04 GMT
Chris Chang wrote:

> Hi Folks,
> <!-- same scenario as previous posting from Chuck -->
> I'm trying to get the samples to work in Orion 1.5.4 but I can't get the
> tests to run.  Everything builds (compile, directory creation, war file,
> etc..) ok
> but the process stops in the "start_orion_15" target.  I get the message
> from Orion saying "Orion/1.5.4 initialized" and then that's it.  The tests
> don't run (which is what I think is supposed to happen next).
> Orion is definitely started because I can pull up the test.jsp page via a
> browser.
> Is there any ideas where to look or what I can do to further debug?
> <!-- same scenario as previous posting from Chuck -->
> P.S.
> Based on the previous posting's suggestion, I already performed the
> followings, still no luck 8(
> 1. verified the testURL="http://localhost:${test.port}/test" is correct
> (i.e. http://localhost:80/test)
> 2. copy all the jar files [Cactus-home]/lib to [Ant-home]/lib (e.g.
> junit.jar, etc.)
> Misc.
> For the sample to work, I have to use Ant 1.5 (Beta1) as task "Fail" does
> not support "unless" in 1.4.1
> Any ideas?
> Thanks in advance
> Chris
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

I'm don't think I can help you with your Orion issues as I've never used
it. I've just gotten my tomcat stuff all working so I'll list the problems
I had, how I got around them, and I'll put my actual build.xml code
in here for what it's worth.

1) I didn't like the idea of having a target in my build.xml that doesn't
    end so instead of using the example start_tomcat target that does it
    using a java task, I used an exec task that calls a 3 line shell script,
    which in turn calls the startup.sh provided as part of tomcat. The key
    there is that it backgrounds the tomcat process so that if someone does
    "ant start_tomcat", the ant process actually ends after it starts tomcat
    and then you can do "ant stop_tomcat" to kill it. If you do it as a java
    task and you do "ant start_tomcat", it'll start it but ant will just sit
    there until you either go to another window and do "ant stop_tomcat" or
    call the tomcat's shutdown script directly. It's been pointed out to me
    that the runservertests target can successfully use a java style start_tomcat
    target, since it knows to shut it down when it's done.

2) I had some trouble with tomcat not starting correctly when I let it
    unravel my .war file. It seemed to hang when it started. I used an
    unjar task to do it manually and it works fine. I still have my init_
    tomcat target copy over the .war and when I figure out why it hangs
    that first time I'll take out my unjar. It's probably something
    wrong with my server.xml file.

Those were the biggest problems. Here's my build.xml:

Note: The various textx properties come from a testx.props file that
each person on the team keeps in their homedir with their values. We
use that for things like db instance to talk to, username to use, etc.
The team members do NOT have to do any tomcat setup/config other than
creating a directory that they have permission to write into and putting
it into their testx.properties file and having the tomcat bin code
mounted on their machine. We all use the same mount point and it's
defined in our top level props file but it could easily be moved to
testx.props if we needed to.

Note2: Rather than having to worry about making any shell scripts in
our build tree executable we just execute them via /usr/bin/sh

<target name="init_tomcat">

   <!-- Create work and conf directories and copy configuration files -->

   <!-- Cleanout dirs -->
   <delete dir="${testx.tomcat_base}/work"/>

   <!-- Remove the auto deployed webapp so that it is redeployed every time -->
   <delete dir="${testx.tomcat_base}/webapps/ncp"/>

   <!-- Create dirs -->
   <mkdir dir="${testx.tomcat_base}/conf"/>
   <mkdir dir="${testx.tomcat_base}/work"/>
   <mkdir dir="${testx.tomcat_base}/logs"/>
   <mkdir dir="${testx.tomcat_base}/webapps"/>
   <mkdir dir="${testx.tomcat_base}/webapps/ncp"/>

   <!-- Copy over config files -->
   <copy todir="${testx.tomcat_base}/conf" filtering="on">
     <fileset dir="${net-nile.tomcat_config}"/>

   <!-- Make replacements in server.xml -->
   <replaceregexp file="${testx.tomcat_base}/conf/server.xml"

   <!-- Copy the war file -->
   <copy file="${net-nile.dist}/ncp.war"

   <!-- Unpack jar. Note: This is only here because if we let tomcat
        unpack it, it hangs the first time it comes up.
   <unjar src="${testx.tomcat_base}/webapps/ncp.war"


<!-- Use the exec versions of start/stop_tomcat. The java ones keep
      the process in the foreground so if you do ant start_tomcat it never
      I left the java ones in here in case we ever need to switch.
<target name="start_tomcat">
   <exec executable="/usr/bin/sh" failonerror="yes">
     <arg value="${net-nile.tomcat_bin}/tomcat.sh"/>
     <arg value="${testx.tomcat_base}"/>
     <arg value="${testx.tomcat_home}/bin/startup.sh"/>

<target name="stop_tomcat">
   <exec executable="/usr/bin/sh" failonerror="yes">
     <arg value="${net-nile.tomcat_bin}/tomcat.sh"/>
     <arg value="${testx.tomcat_base}"/>
     <arg value="${testx.tomcat_home}/bin/shutdown.sh"/>

<target name="old_start_tomcat">
   <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"
     <jvmarg value="-Dcatalina.home=${testx.tomcat_home}"/>
     <jvmarg value="-Dcatalina.base=${testx.tomcat_base}"/>
     <arg value="start"/>
       <fileset refid="net-nile.jdk.classpath"/>
       <fileset dir="${testx.tomcat_home}">
         <include name="bin/bootstrap.jar"/>

<target name="old_stop_tomcat">
   <java classname="org.apache.catalina.startup.Bootstrap" fork="yes"
     <jvmarg value="-Dcatalina.home=${testx.tomcat_home}"/>
     <jvmarg value="-Dcatalina.base=${testx.tomcat_base}"/>
     <arg value="stop"/>
       <fileset refid="net-nile.jdk.classpath"/>
       <fileset dir="${testx.tomcat_home}">
         <include name="bin/bootstrap.jar"/>

<target name="testx_tomcat">

Here's my tomcat.sh script:


					Chuck Brunson
					AIM: chuck9206

To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

View raw message