Hi Richard,

As you have guessed there are 2 ways to pass the cactus.contextURL
system property:

- in the classpath. But that's the client classpath (i.e. from where the
JUnit Test Runner is run). As you're running the tests using the Cactus
ServletTestRunner, that means that you can put cactus.properties in the
mywebapp/WEB-INF/classes directory.

- by passing it to the JVM using the "-D" prefix. 

(and of course by setting it in your test case but that's not the best
way).

As I'm answering a but late, you may already have make it work...

Cheers,
-Vincent

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf
> Of Richard Robinson
> Sent: 01 January 2003 21:58
> To: [EMAIL PROTECTED]
> Subject: cactus.properties in classpath, cactus.contextURL
> 
> 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.what
ev
> er.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-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to