Hi Diana, > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: vendredi 30 juillet 2004 22:55 > To: [EMAIL PROTECTED] > Subject: Cactus log not showing any log errors > > I'm new to Cactus & JUnit and have been spending too much time trying to > get the cactus logging working so I can get more information on why I may > be getting the "ChainedRuntimeException" errors when running my JUnit > tests. Ultimately I'd like to get the cactus logging working so it not > only creates the log file but actually writes messages out to it. > Secondly, I'd like to figure out how to resovle the errors I'm getting > when running the JUnit tests. Currently, I'm getting the following error > when running my tests using the GUI interface in WebSphere Application > Developer . . .
Lots of questions... ;-) > > org.apache.cactus.util.ChainedRuntimeException: Missing Cactus property > [cactus.contextURL] > at > org.apache.cactus.internal.configuration.BaseConfiguration.getContextURL(B > aseConfiguration.java:59) > at > org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedir > ectorURL_aroundBody0(AbstractWebConfiguration.java:46) > at > org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedir > ectorURL_aroundBody1$advice(AbstractWebConfiguration.java:206) > at > org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedir > ectorURL(AbstractWebConfiguration.java) > at > org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRun > Test(DefaultHttpClient.java:159) [snip] Ok, this means that the cactus.properties is *NOT* in the executing classpath. In Java, it means is that the directory where cactus.properties is located is not in the CP. You need to add it to your JUnit launch configuration in Eclipse I guess. > > I've been trying to setup cactus logging to get more information on cactus > errors with possible resolutions, and, while my cactus log file is being > created, I'm not seeing any errors getting logged in the file that gets > created. > > I'm trying to integrate Cactus & JUnit logging. Here's my setup and > config files. > > In my JavaSource folder (where I have my JUnit test cases), I have the > cactus.properties file with the following code inside . . . You need to verify that the cactus.properties gets copied to the Eclipse output directory (which I believe is added to the JUnit launch CP by default). Otherwise you'll need to explicitely add the dir to the launch config. > > cactus.contextURL=http://localhost:9080/fedmail > cactus.servletRedirectorName=ServletTestRedirector This property is not required (it is the default) > cactus.jspRedirectorName = \user\jspRedirector This is definitely wrong. BTW, you should not change it. > cactus.logging.config = > c:\\tmp\\dev\\fedmailUnitTest\\WebContent\\WEB-INF\\logging- > server.properties You can also use forward slashes instead. > cactus.enableLogging=true > > In my WEB-INF folder, I have a logging-server.properties file, with the > following code inside. Note: I've uncommented the Log4J line since Log4J > is the logging mechanism I wish to integrate with . . . Yes, that's the right way of doing it. > > # > -------------------------------------------------------------------------- > --- > # Logging properties > # > -------------------------------------------------------------------------- > --- > > # Disable logging by default when running the tests. If you wish to use a > # logging subsystem, uncomment the line below. That will let Commons > logging > # decide automatically of a suitable logging system for you. You can also > force > # commons-logging to use a specific logging system. For more info, see > # http://jakarta.apache.org/commons/logging > > # Disable logging > #org.apache.commons.logging.Log = org.apache.commons.logging.impl.NoOpLog > > # Force to use JDK 1.4 logging > #org.apache.commons.logging.Log = > org.apache.commons.logging.impl.Jdk14Logger > > # Force to use Log4J logging > org.apache.commons.logging.Log = > org.apache.commons.logging.impl.Log4JLogger > > # Force to use Simple logging > #org.apache.commons.logging.Log = > org.apache.commons.logging.impl.SimpleLog > > Also in my WEB-INF folder, I have the log4j.properties configuration file > with the following code . . . How will that work? How will Log4j know to look for the log4j.properties file there?!! Please check http://jakarta.apache.org/cactus/integration/manual/howto_config.html which contains explanations on how to set up the logging config. [snip] > > Any help you could provide would be appreciated. Thanks. If you wish to log on the Cactus client side you'll also need to set it up. Thanks -Vincent --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
