You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by chrisgage <ch...@bellsouth.net> on 2009/10/28 14:53:14 UTC

FileAppender is not assignable to Appender

With an application we have been running in production, we recently added
some jar files from another department's application in order to have the
wto apps communicate.

Since then we have been getting the following error in the log at
application startup.  It does not appear to cause log4j to stop working,
it's just a worrying thing to see in the log.  I am using log4j as a black
box at the simplest possible level, so this message is completely
incomprehensible to me, and it gives no stack trace or other indication
where the problem is occurring.

log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable to a
"org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [
com.ibm.ws.classloader.CompoundClassLoader@d940d94
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST] whereas object of type 
log4j:ERROR "org.apache.log4j.FileAppender" was loaded by [
com.ibm.ws.classloader.CompoundClassLoader@8060806
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST].
log4j:ERROR Could not instantiate appender named "SPRINGLOG".

Actually this set of messages occurs twice, once for FileAppender and the
repeated almost identically for ConsoleAppender.
-- 
View this message in context: http://www.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26095007.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: FileAppender is not assignable to Appender

Posted by Brett Randall <ja...@gmail.com>.
Log4j is identifying the classloaders with incompatible versions of the
classes referenced.  The classpaths are missing so hard for me to deduce
more, but you may be able to determine which WAS classloaders in the
webapp's classloader hierarchy have been responsible for loading the
incompatible versions, which may lead to the reason why this is occuring.

If you are running log4j 1.2.6 or later try setting system property
log4j.ignoreTCL=true to tell log4j to not-prefer the thread context
classloader.

Brett

On Sun, Nov 1, 2009 at 2:41 PM, chrisgage <ch...@bellsouth.net> wrote:

>
> This project started using Spring (and its dependency on commons logging)
> back in June 2007, but this problem only started this summer, two years
> later.  In those two years it has grown to 200 JSPs and over 1000 classes
> so
> it's hard to find an error that refuses to say exactly where it was
> created.
>
> But I do appreciate the contribution, and will check it out...
>
>
> javabrett wrote:
> >
> > Check whether the added JARs include Commons Logging. I notice that the
> > Appender is named after Spring. Spring depends on Commons Logging which
> is
> > notorious for creating classloading challenges.
> >
> --
> View this message in context:
> http://old.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26148077.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: FileAppender is not assignable to Appender

Posted by chrisgage <ch...@bellsouth.net>.
This project started using Spring (and its dependency on commons logging)
back in June 2007, but this problem only started this summer, two years
later.  In those two years it has grown to 200 JSPs and over 1000 classes so
it's hard to find an error that refuses to say exactly where it was created.

But I do appreciate the contribution, and will check it out...


javabrett wrote:
> 
> Check whether the added JARs include Commons Logging. I notice that the
> Appender is named after Spring. Spring depends on Commons Logging which is
> notorious for creating classloading challenges.
> 
-- 
View this message in context: http://old.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26148077.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: FileAppender is not assignable to Appender

Posted by Brett Randall <ja...@gmail.com>.
Check whether the added JARs include Commons Logging. I notice that
the Appender is named after Spring. Spring depends on Commons Logging
which is notorious for creating classloading challenges.

Brett


On 10/29/09, chrisgage <ch...@bellsouth.net> wrote:
>
> That was what I thought originally.  But that isn't it...
>
> The jars we added definitely do not contain a log4j.jar, (I have checked the
> source and unzipped the jar files to be sure) and the only one in the
> workspace is log4j-1.2.15.jar in the lib folder of the EAR project.  And all
> the jar manifests of the component projects point to lib/log4j-1.2.15.jar.
> We use IBM RAD7 and WebSphere 6.1.
>
>
> Bender Heri wrote:
>>
>> My guess: there are two log4j.jar, probably of different versions: one in
>> the parent classlaoder and one in the child classloader. Therefore java
>> regards these two as different classes.
>> Heri
>>
>> -----Ursprüngliche Nachricht-----
>> Von: chrisgage [mailto:chrisgage@bellsouth.net]
>> Gesendet: Mittwoch, 28. Oktober 2009 14:53
>> An: log4j-user@logging.apache.org
>> Betreff: FileAppender is not assignable to Appender
>>
>> With an application we have been running in production, we recently added
>> some jar files from another department's application in order to have the
>> wto apps communicate.
>>
>> Since then we have been getting the following error in the log at
>> application startup.  It does not appear to cause log4j to stop working,
>> it's just a worrying thing to see in the log.  I am using log4j as a black
>> box at the simplest possible level, so this message is completely
>> incomprehensible to me, and it gives no stack trace or other indication
>> where the problem is occurring.
>>
>> A "org.apache.log4j.FileAppender" object is not assignable to a
>> "org.apache.log4j.Appender" variable. The class
>> "org.apache.log4j.Appender" was loaded by
>> com.ibm.ws.classloader.CompoundClassLoader@d940d94 Local ClassPath: ...
>> Delegation Mode: PARENT_FIRST whereas object of type
>> "org.apache.log4j.FileAppender" was loaded by
>> com.ibm.ws.classloader.CompoundClassLoader@8060806 Local ClassPath: ...
>> Delegation Mode: PARENT_FIRST. Could not instantiate appender named
>> "SPRINGLOG".
>>
>> Actually this set of messages occurs twice, once for FileAppender and the
>> repeated almost identically for ConsoleAppender.
>>
>
> --
> View this message in context:
> http://www.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26112525.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: AW: FileAppender is not assignable to Appender

Posted by chrisgage <ch...@bellsouth.net>.
That was what I thought originally.  But that isn't it...  

The jars we added definitely do not contain a log4j.jar, (I have checked the
source and unzipped the jar files to be sure) and the only one in the
workspace is log4j-1.2.15.jar in the lib folder of the EAR project.  And all
the jar manifests of the component projects point to lib/log4j-1.2.15.jar. 
We use IBM RAD7 and WebSphere 6.1.


Bender Heri wrote:
> 
> My guess: there are two log4j.jar, probably of different versions: one in
> the parent classlaoder and one in the child classloader. Therefore java
> regards these two as different classes.
> Heri
> 
> -----Ursprüngliche Nachricht-----
> Von: chrisgage [mailto:chrisgage@bellsouth.net] 
> Gesendet: Mittwoch, 28. Oktober 2009 14:53
> An: log4j-user@logging.apache.org
> Betreff: FileAppender is not assignable to Appender
> 
> With an application we have been running in production, we recently added
> some jar files from another department's application in order to have the
> wto apps communicate.
> 
> Since then we have been getting the following error in the log at
> application startup.  It does not appear to cause log4j to stop working,
> it's just a worrying thing to see in the log.  I am using log4j as a black
> box at the simplest possible level, so this message is completely
> incomprehensible to me, and it gives no stack trace or other indication
> where the problem is occurring.
> 
> A "org.apache.log4j.FileAppender" object is not assignable to a
> "org.apache.log4j.Appender" variable. The class
> "org.apache.log4j.Appender" was loaded by
> com.ibm.ws.classloader.CompoundClassLoader@d940d94 Local ClassPath: ...
> Delegation Mode: PARENT_FIRST whereas object of type
> "org.apache.log4j.FileAppender" was loaded by
> com.ibm.ws.classloader.CompoundClassLoader@8060806 Local ClassPath: ...
> Delegation Mode: PARENT_FIRST. Could not instantiate appender named
> "SPRINGLOG".
> 
> Actually this set of messages occurs twice, once for FileAppender and the
> repeated almost identically for ConsoleAppender.
> 

-- 
View this message in context: http://www.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26112525.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


AW: FileAppender is not assignable to Appender

Posted by Bender Heri <hb...@ergonomics.ch>.
My guess: there are two log4j.jar, probably of different versions: one in the parent classlaoder and one in the child classloader. Therefore java regards these two as different classes.
Heri

-----Ursprüngliche Nachricht-----
Von: chrisgage [mailto:chrisgage@bellsouth.net] 
Gesendet: Mittwoch, 28. Oktober 2009 14:53
An: log4j-user@logging.apache.org
Betreff: FileAppender is not assignable to Appender


With an application we have been running in production, we recently added some jar files from another department's application in order to have the wto apps communicate.

Since then we have been getting the following error in the log at application startup.  It does not appear to cause log4j to stop working, it's just a worrying thing to see in the log.  I am using log4j as a black box at the simplest possible level, so this message is completely incomprehensible to me, and it gives no stack trace or other indication where the problem is occurring.

log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [
com.ibm.ws.classloader.CompoundClassLoader@d940d94
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST] whereas object of type log4j:ERROR "org.apache.log4j.FileAppender" was loaded by [
com.ibm.ws.classloader.CompoundClassLoader@8060806
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST].
log4j:ERROR Could not instantiate appender named "SPRINGLOG".

Actually this set of messages occurs twice, once for FileAppender and the repeated almost identically for ConsoleAppender.
--
View this message in context: http://www.nabble.com/FileAppender-is-not-assignable-to-Appender-tp26095007p26095007.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org