You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Chris Chang <ch...@cendec.com> on 2002/05/02 19:06:14 UTC

Problem getting the samples (Cactus 1.3) to run in Orion 1.5.4

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem getting the samples (Cactus 1.3) to run in Orion 1.5.4

Posted by Charles Brunson <ch...@sun.com>.
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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@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.

Problems:
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}"/>
   </copy>

   <!-- Make replacements in server.xml -->
   <replaceregexp file="${testx.tomcat_base}/conf/server.xml"
     match="@port"
     replace="${testx.tomcat_port}"
     flags="g"
   />

   <!-- Copy the war file -->
   <copy file="${net-nile.dist}/ncp.war"
         tofile="${testx.tomcat_base}/webapps/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"
          dest="${testx.tomcat_base}/webapps/ncp"/>

</target>

<!-- 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
      exits.
      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"/>
   </exec>
</target>

<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"/>
   </exec>
</target>

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

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

<target name="testx_tomcat">
   <runservertests
     testURL="${testx.testURL}"
     startTarget="start_tomcat"
     stopTarget="stop_tomcat"
     testTarget="testx"/>
</target>

--------------------------
Here's my tomcat.sh script:
#!/usr/bin/sh

CATALINA_BASE=$1
export CATALINA_BASE
$2


-- 
					Chuck Brunson
					x56912
					719-277-6912
					charles.brunson@sun.com
					AIM: chuck9206


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problem getting the samples (Cactus 1.3) to run in Orion 1.5.4

Posted by Vincent Massol <vm...@octo.com>.
Hi Chris,

> -----Original Message-----
> From: Chris Chang [mailto:chris.chang@cendec.com]
> Sent: 02 May 2002 18:06
> To: 'cactus-user@jakarta.apache.org'
> Subject: Problem getting the samples (Cactus 1.3) to run in Orion
1.5.4
> 
> 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?
> 

yes, run Ant in debug mode : "ant -debug xxx". The runservertests will
print some information on why it cannot call the URL.

> <!-- 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.)
> 

I still believe the URL is not valid for some reason.

> 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
> 

Yes, that is right. That's an error that was introduced. You can either
remove the the line that fails (the <fail> line) or do as you've done an
use Ant 1.5. I'll put that in the Migration guide on the web site and in
the FAQ.

> Any ideas?
> 
> Thanks in advance
> 
> Chris
> 

-Vincent



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>