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 . . .
org.apache.cactus.util.ChainedRuntimeException: Missing Cactus property
[cactus.contextURL]
at
org.apache.cactus.internal.configuration.BaseConfiguration.getContextURL(BaseConfiguration.java:59)
at
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody0(AbstractWebConfiguration.java:46)
at
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody1$advice(AbstractWebConfiguration.java:206)
at
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL(AbstractWebConfiguration.java)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:159)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:206)
at
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:206)
at
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java)
at
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144)
at
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215)
at
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
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 . . .
cactus.contextURL=http://localhost:9080/fedmail
cactus.servletRedirectorName=ServletTestRedirector
cactus.jspRedirectorName = \user\jspRedirector
cactus.logging.config =
c:\\tmp\\dev\\fedmailUnitTest\\WebContent\\WEB-INF\\logging-server.properties
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 . . .
#
-----------------------------------------------------------------------------
# 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 . . .
# Following properties are useful if you're using the Log4J logging
subsystem
# and wish to output cactus logs to a file.
log4j.configuration = file:logging-server.properties
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = C:\\tmp\\fedmailCactus_server.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p
%-30.30c{2} %x - %m %n
log4j.debug=true
log4j.rootCategory=DEBUG,FILE1,CON,cactus
# By default we don't log at the DEBUG level for Cactus log, in order not
# to generate too many logs. However, should a problem arise and logs need
# to be sent to the Cactus dev team, then we will ask you to change this
to
# DEBUG.
log4j.category.org.apache.cactus = DEBUG, cactus
log4j.additivity.org.apache.cactus=false
# Debug logs for HttpClient
log4j.category.org.apache.commons.httpclient = DEBUG, cactus
log4j.additivity.org.apache.commons.httpclient = false
log4j.category.httpclient = WARN, cactus
log4j.additivity.httpclient = false
# Console Appender
log4j.appender.CON=org.apache.log4j.ConsoleAppender
log4j.appender.CON.layout=org.apache.log4j.PatternLayout
log4j.appender.CON.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c
(%M:%L) %m%n
# Rolling File Appender
log4j.appender.FILE1=org.apache.log4j.RollingFileAppender
log4j.appender.FILE1.File=C:\\tmp\\wslog4j.log
log4j.appender.FILE1.MaxFileSize=2000KB
log4j.appender.FILE1.MaxBackupIndex=9
log4j.appender.FILE1.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE1.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c
(%M:%L) %m%n
# Renderers
log4j.renderer.java.lang.Exception=org.frb.mpls.util.ExceptionRenderer
# Category Configurations
log4j.logger.org.frb.mpls=DEBUG
log4j.logger.org.frb.mpls.fm=INFO
log4j.logger.org.frb.mpls.fm.db=INFO
log4j.logger.org.frb.mpls.fm.webservice=DEBUG
log4j.logger.org.frb.mpls.fm.broadcast=DEBUG
log4j.logger.org.frb.mpls.fm.web=INFO
log4j.logger.org.frb.mpls.fm.web.menu=INFO
# JSP configurations
log4j.logger.jsp=DEBUG
# Enter the page name (no jsp extensions).
log4j.logger.jsp.testpage=DEBUG
# log4j.logger.jsp=DEBUG
# log4j.logger.com.sssw.gen.pages=DEBUG
Any help you could provide would be appreciated. Thanks.
================================
Diana M. Fasching
mailto:[EMAIL PROTECTED]
================================