jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Robinson <Richa...@LDR.com>
Subject Re: cactus.properties in classpath, cactus.contextURL
Date Wed, 01 Jan 2003 21:53:47 GMT
Some extra information.

I've created a ServletTest.java (not using Cactus or Junit...) in the same directory as SampleServletTest.java.
ServletTest.java is basically a hollow servlet that merely prints out the current value (if
any) of the
cactus.contextURL. (System.getProperty( "cactus.contextURL").

Even though I *do* have a cactus.properties file in the JVM classpath ($TOMCAT/common/classes)
which contains, as
specified in last posting, a cactus.contextURL of "http://host.domain.com:8080/myWebApp/",
nevertheless the
ServletTest.java displays the following value:

  cactus.contextURL: null

Which leads me to conclude that cactus.properties file is NOT being picked up on.

Any ideas where I should be putting the cactus.properties file for server side testing with
Cactus?

-- Richard


Richard Robinson wrote:

> Hello,
>
> I've read through the Cactus Howtos and have been moderately successful
> installing and configuring Cactus 1.4.1 (J2EE 1.3) on a Red Hat Linux
> 7.1, using Tomcat 4.0.4 and JBoss 2.4. My webapp is in a different
> directory than the default. I.e. "$HTTPD_DOCROOT/webapps/myWebApp". My
> source files (JSP, servlets, EJBs, etc.) are compiled in a different
> directory, using Ant, and deployed under the myWebApp. All this works as
> it should.
>
> A SampleServletTest file (as per the docs) works WHEN I add the
> following to the beginSaveToSessionOK method:
>
>    System.setProperty( "cactus.contextURL",
> "http://host.domain.com:8080/myWebApp/" );
>
> I am running the test via a brower (IE 5 on Win XP) using the following
> URL:
>
> http://host.domain.com/myWebApp/servlet/ServletTestRunner?suite=com.whatever.whatever.servlets.SampleServletTest
>
> But I'd like to set the contextURL rather via the cactus.properties
> file. I have one. But try as I may I cannot get the Tomcat JVM to pick
> up on it. Contents of cactus.properties are one line as follows
> (indented only for this email):
>
>    cactus.contextURL = http://host.domain.com:8080/myWebApp/
>
> I'm presuming it is a question of setting the JVM that Tomcat runs in.
> Surely it cannot be the Jboss JVM. And there is no other JVM to speak
> of. The Tomcat 4.0.4 Classloader howto is pretty explicit on where the
> classpath is picked up and in what order. I've tried copying
> cactus.properties (which incidentally is owned by root, but world and
> group readable) to various places --
>
>    $HTTPD_DOCROOT/webapps/myWebApp/classes
>    $TOMCAT_HOME/common/classes
>    $TOMCAT_HOME/classes
>    In the same directory as the SampleServletTest file (under
> webapp/crm/classes/package ... )
>
> After rebooting Tomcat, and retrying the URL via a browser (as per
> above), I still get this error: "Not Found: The requested URL
> /myWebApp/ServletRedirector was not found on this server"
>
> Does anyone have any suggestions?
>
> I've even tried adding
> "-Dcactus.contextURL=http://host.domain.com:8080/myWebApp/" to JAVA_OPTS
> environment variable, exporting it (from tomcat rc file), which should
> be picked up by the JVM Tomcat starts in, but this doesn't work either.
>
> At this point I'm feeling a bit doubtful about my understanding of the
> whole Tomcat Classloader stuff. But perhaps it is the format of the -D
> command or the cactus.properties file?
>
> Can any one help?
>
> --
> Richard Robinson
>
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

--
Richard Robinson
Operations Manager
Fusion Systems International
T: 503-255-5800 x172
E: RichardR@FusionSystems.com
W: http://www.FusionSystems.com



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message