Hi Shawn,
It seems to be a known issue that we have with Cactus 1.1 which should be
easy to correct. What happens in is that log4j is initialized in the Cactus
redirector (i.e. in the JVM of your application server), meaning that if
Bluestone itself is using Log4j, it will probably close it's existing
appenders and thus any call to log from Bluestone will result in the error
displayed in it's console. Maybe the same happens in the other way.
What I suggest is to try to modify your Cactus Log4j configuration (files
log_server.properties and log_client.properties). Currently it should be
something like (for log_server.properties) :
----
# Properties for configuring Log4j
# This is the configuring for logging on the server side
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = cactus_server.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %r [%t] %-5p %c{2} %x - %m
%n
log4j.rootCategory = DEBUG, cactus
---
Change it to be :
---
# Properties for configuring Log4j
# This is the configuring for logging on the server side
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = cactus_server.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %r [%t] %-5p %c{2} %x - %m
%n
log4j.category.org.apache.commons.cactus = DEBUG, cactus
---
So that only the classes in package org.apache.commons.cactus will use the
"cactus" appender.
Now the problem of initialization may still remain. Can you give it a try
and tell me how it goes ? I'll send a patch for the initialization code if
it is still a problem.
Thanks
Note 1: It will be corrected in the next version of Cactus. The above
mentionned correction has already been done in Cactus in CVS.
Sorry about that.
Note 2: Once you have the Ant script working for Bluestone, I would be very
interested if you could contribute it so that we can add it to our list of
"supported" application servers. Thanks
-Vincent
----- Original Message -----
From: "Storoe, Shawn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 24, 2001 11:07 PM
Subject: Help with log4j and cactus
> I am currently working on a project that is using the following
> products.
>
> Bluestone application server.
>
> Ant Scripts to run cactus and junit tests.
>
> Up to this point, I have not had any problem logging from out
> application. However once I started extending ServletTestCase instead
> of TestCase, I started to get errors as follows from both the ant
> scripts and the Bluestone server console.
>
> I have searched everywhere on the web and cannot find any pointers or
> hints to get around this problem.
>
> Does anyone have any ideas?
>
>
> Ant Scripts:
>
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
> [junit] log4j:WARN Not allowed to write to a closed appender.
> [junit] log4j:ERROR Attempted to append to closed appender named
> [TEMP1].
>
> Bluestone server console.
>
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [TEMP].
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [TEMP].
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [TEMP].
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [TEMP].
> log4j:WARN Not allowed to write to a closed appender.
> log4j:ERROR Attempted to append to closed appender named [TEMP].
>
>
> All of the log4j logging appears to work fine if I am not in the
> ServletTestCase?
>
> Thanks
>
> Shawn Storoe
>