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 Ceki Gülcü <ce...@qos.ch> on 2002/06/20 14:35:08 UTC

Re: Tomcat initialization by a property file - fails with own Appender

You are using JDK 1.4, right? According to previous reports, the problem is 
probably due to a JDK 1.4 bug.
HTH,

At 15:23 20.06.2002 +0300, Shimon Crown wrote:
>Tomcat 4.0.4
>
>I am trying to initialize the logger for my web application using a property
>file. If I use a standard appender such as ConsoleAppender (see example
>below) then it works fine. However if I try and use my own appender which
>extends AppenderSkeleton then I get the following nasty message.
>
>log4j:ERROR A "co.il.equipnet.utilities.EqEventLogAppender" object is not
>assignable to a "org.apache.log4j.Appender" variable.
>log4j:ERROR Could not instantiate appender named "CONSOLE".
>
>The same thing works fine in a standalone application. Additionally if I can
>initialize and use this appender within a servlet or ServletContextListener.
>It is only with property files that I get this problem.
>
>Note - Searching the archives shows that variants of this question have been
>asked before but the answers are not at all clear to me so I am forced to
>trouble you.

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat initialization by a property file - fails with own Appender

Posted by Shimon Crown <sh...@equipnet.co.il>.
I actually deleted 1.4 from my system to test this and I get exactly the
same results with JDK 1.3.1.

I have tried with various versions of Log4j (1.1.3, 1.2.1 and 1.2.4) with
the same results. As I had the time I played around with the Log4j source
and I see that it is failing in

OptionConverter.instantiateByClassName(String className, Class
superClass,Object defaultValue) .
Specifically the call that fails is Class.isAssignableFrom.

This is obviously NOT news to you. I guess we have a ClassLoader problem
here which may well be due to the JDK implementations on Windows.

This issue really isn't too important to me as I can carry on initializing
log4j with intialization parameters in my webapplication web.xml file as I
have been doing to now.  Further down the road we might want to try system
wide initialization by JNDI but I shall cross that bridge when I come to it.

Thanks for the help (and for a really great product).

Shimon


----- Original Message -----
From: Ceki Gülcü <ce...@qos.ch>
To: Log4J Users List <lo...@jakarta.apache.org>
Sent: Thursday, June 20, 2002 3:35 PM
Subject: Re: Tomcat initialization by a property file - fails with own
Appender


>
> You are using JDK 1.4, right? According to previous reports, the problem
is
> probably due to a JDK 1.4 bug.
> HTH,
>
> At 15:23 20.06.2002 +0300, Shimon Crown wrote:
> >Tomcat 4.0.4
> >
> >I am trying to initialize the logger for my web application using a
property
> >file. If I use a standard appender such as ConsoleAppender (see example
> >below) then it works fine. However if I try and use my own appender which
> >extends AppenderSkeleton then I get the following nasty message.
> >
> >log4j:ERROR A "co.il.equipnet.utilities.EqEventLogAppender" object is not
> >assignable to a "org.apache.log4j.Appender" variable.
> >log4j:ERROR Could not instantiate appender named "CONSOLE".
> >
> >The same thing works fine in a standalone application. Additionally if I
can
> >initialize and use this appender within a servlet or
ServletContextListener.
> >It is only with property files that I get this problem.
> >
> >Note - Searching the archives shows that variants of this question have
been
> >asked before but the answers are not at all clear to me so I am forced to
> >trouble you.
>
> --
> Ceki
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat initialization by a property file - fails with own Appender

Posted by Ceki Gülcü <ce...@qos.ch>.
Are you absolutely sure that you are using JDK 1.3.1? When you install JDK 
1.4 it inserts itself on the WINDOWS directory so it gets used even if you 
intend otherwise. What does "java -version" give you?

At 16:23 20.06.2002 +0300, Shimon Crown wrote:
>Ceki,
>
>I am using JDK 1.4. However I get the same problem when I switch to JDK1.3.1
>
>Shimon
>
>----- Original Message -----
>From: Ceki Gülcü <ce...@qos.ch>
>To: Log4J Users List <lo...@jakarta.apache.org>
>Sent: Thursday, June 20, 2002 3:35 PM
>Subject: Re: Tomcat initialization by a property file - fails with own
>Appender
>
>
> >
> > You are using JDK 1.4, right? According to previous reports, the problem
>is
> > probably due to a JDK 1.4 bug.
> > HTH,
> >
> > At 15:23 20.06.2002 +0300, Shimon Crown wrote:
> > >Tomcat 4.0.4
> > >
> > >I am trying to initialize the logger for my web application using a
>property
> > >file. If I use a standard appender such as ConsoleAppender (see example
> > >below) then it works fine. However if I try and use my own appender which
> > >extends AppenderSkeleton then I get the following nasty message.
> > >
> > >log4j:ERROR A "co.il.equipnet.utilities.EqEventLogAppender" object is not
> > >assignable to a "org.apache.log4j.Appender" variable.
> > >log4j:ERROR Could not instantiate appender named "CONSOLE".
> > >
> > >The same thing works fine in a standalone application. Additionally if I
>can
> > >initialize and use this appender within a servlet or
>ServletContextListener.
> > >It is only with property files that I get this problem.
> > >
> > >Note - Searching the archives shows that variants of this question have
>been
> > >asked before but the answers are not at all clear to me so I am forced to
> > >trouble you.
> >
> > --
> > Ceki
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat initialization by a property file - fails with own Appender

Posted by Shimon Crown <sh...@equipnet.co.il>.
Ceki,

I am using JDK 1.4. However I get the same problem when I switch to JDK1.3.1

Shimon

----- Original Message -----
From: Ceki Gülcü <ce...@qos.ch>
To: Log4J Users List <lo...@jakarta.apache.org>
Sent: Thursday, June 20, 2002 3:35 PM
Subject: Re: Tomcat initialization by a property file - fails with own
Appender


>
> You are using JDK 1.4, right? According to previous reports, the problem
is
> probably due to a JDK 1.4 bug.
> HTH,
>
> At 15:23 20.06.2002 +0300, Shimon Crown wrote:
> >Tomcat 4.0.4
> >
> >I am trying to initialize the logger for my web application using a
property
> >file. If I use a standard appender such as ConsoleAppender (see example
> >below) then it works fine. However if I try and use my own appender which
> >extends AppenderSkeleton then I get the following nasty message.
> >
> >log4j:ERROR A "co.il.equipnet.utilities.EqEventLogAppender" object is not
> >assignable to a "org.apache.log4j.Appender" variable.
> >log4j:ERROR Could not instantiate appender named "CONSOLE".
> >
> >The same thing works fine in a standalone application. Additionally if I
can
> >initialize and use this appender within a servlet or
ServletContextListener.
> >It is only with property files that I get this problem.
> >
> >Note - Searching the archives shows that variants of this question have
been
> >asked before but the answers are not at all clear to me so I am forced to
> >trouble you.
>
> --
> Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>