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 Tim Wei <Ti...@telus.com> on 2002/02/27 23:31:51 UTC

RE: org/apache/log4j/Logger NoClassDefFoundError with version 1.1 .3

Now Logger in the 1.1.3 version. You have to user Category class.

Logger is in the beta version.

> -----Original Message-----
> From:	Vincent Massol [SMTP:vmassol@octo.com]
> Sent:	Wednesday, February 27, 2002 5:15 PM
> To:	log4j-user@jakarta.apache.org
> Subject:	org/apache/log4j/Logger NoClassDefFoundError with version
> 1.1.3
> 
> Hi,
> 
> I am having a strange problem that I'm failing to resolve on my own. It
> appears I'm not the only one as several other persons have also reported
> it to me.
> 
> The contenders are Log4J 1.1.3, Log4J 1.2 and Cactus. 
> 
> * When I run Cactus with log4j 1.1.3 in the classpath, I get a
> "org/apache/log4j/Logger" NoClassDefFoundError. 
> * The problem is that in Cactus I do not use anything else than the
> Log4J Category class. 
> * To ensure this, I am even building the Cactus jar with log4J 1.1.3.
> 
> This is driving me crazy ;-). Obviously, at first glance, you would say
> that one of the 3 assertions above has to be false, right ? The problem
> is that I have checked and rechecked several times (asking the help of
> others too) and I still cannot see what's wrong.
> 
> Any idea, hint, RTFM, have some fresh air, etc ?
> 
> Thanks
> -Vincent
> 
> P.S.: I realize it is certainly a fault on my side. However, I'm
> completely stuck and others have been reporting same kinds of errors
> (using Cactus).
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

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


Re: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError with version 1.1.3

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi Vincent,

You are probably not doing anything wrong and it most probably a log4j
problem. In log4j 1.2 beta2 and earlier versions there was a serious
compatibility problem where code compiled with log4j 1.1.3 would not
run with log4j-1.2x.jar. However, the same code would compile and run
fine if compiled with log4j 1.2x. This problem was corrected with
log4j 1.2beta3. At least that is what I thought until now.

My educated guess (still a guess) is that parts of your application
are compiled using log4j 1.2X. Is it possible that the classes in
WEB-INF/classes were compiled with log4j 1.2betaX?

I would be very interested in the NoClassDefFoundError stack
trace. Regards, Ceki

At 00:11 28.02.2002 +0000, Vincent Massol wrote:
>Following the thread "org/apache/log4j/Logger NoClassDefFoundError with
>version 1.1.3" here are my findings (and more questions) :
>
>1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1 SP2
>2/ I tested the following structure :
>
>myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
>This worked fine (there was no log4j.jar and cactus does not try to log
>if log4j is not in the classpath).
>
>3/ Then I had the following structure (which is the structure I was
>having problem with) :
>
>myear.ear
>   |_ META-INF
>     |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
>   |_ log4j.jar (VERSION 1.1.3 !!)
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
>This failed with the error "org/apache/log4j/Logger"
>NoClassDefFoundError. This means that :
>a/ cactus was able to "see" log4j.jar from its classloader
>b/ the only log4j.jar file it could see was the one under myear.ear and
>thus in version 1.1.3 !
>
>4/ Then I tested with the following structure :
>
>myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>       |_ log4j.jar (VERSION 1.1.3 !!)
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
>This worked fine ! This proves that Cactus is NOT using the Logger
>class.
>
>Question : Where does the "org/apache/log4j/Logger" NoClassDefFoundError
>comes from ?
>
>Note: It cannot come from a log4j.jar that would be in the system
>classpath because in step 2/ the cactus.jar would have "seen" log4j.jar
>(the webapp CL is a child of the system CL).
>
>What am I doing wrong ? :-)
>
>Thanks
>-Vincent
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


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


Re: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError withversion 1.1.3

Posted by T Master <tm...@iknowledge.com>.
Do you have a version of Cactus previous to when the problems occurred?
Note any differences?   Just a thought!

ps, i laughed at the grin!

----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>
To: "'Log4J Users List'" <lo...@jakarta.apache.org>; <ks...@pacbell.net>
Sent: Thursday, February 28, 2002 1:43 PM
Subject: RE: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError
withversion 1.1.3


> Kevin,
>
> First, thanks for your help.
>
> > -----Original Message-----
> > From: Kevin Steppe [mailto:ksteppe@pacbell.net]
> > Sent: 28 February 2002 20:02
> > To: Log4J Users List
> > Subject: Re: [The plot continues] org/apache/log4j/Logger
> > NoClassDefFoundError withversion 1.1.3
> >
> > Ok, I'll wade in on this one a bit:
> >
> > A) Have you tried the Cactus mailing list?  This seems intimately tied
> to
> > Cactus.
>
> <huge grin/>
>
> I am the creator of Cactus (I would answer to myself on the list if I
> knew the answer, though ;-) ). What I am debugging is Cactus itself !
>
> That said, you are right, it is linked to Cactus :-)
>
> > B) Note that if Cactus can not load the PropertyConfigurator class it
> will
> > pretend to be fine, but in fact do nothing (this seems like very very
> > dangerous
> > behvior in logging to me -- "Hey I can't actually do any logging;
> instead
> > I'll
> > ignore it and not tell you!"
>
> I don't agree. This logging is purely internal to Cactus and has nothing
> to do with application logging. And I wanted to make it transparent for
> the user.
>
> That said, I am changing this behaviour. The new one will be : no cactus
> logging unless you tell it so.
>
> > So my interpretation of your trials:
> >     2/ As you said, log4j.jar not found, Cactus does nothing.
>
> Yes, I know, that's why I removed my log4j.jar ! To prove that no other
> log4 classes were in the classpath anywhere ! (Please reread my email
> slowly).
>
> >     3/ As you said, log4j.jar found and Cactus bombs out mysteriously
>
> yep, that's what I'd like to know ... :-)
>
> >     4/ Here I think Cactus is not finding log4j.jar and so it
> continues.
> > Are
> > you getting a log file, statements, etc from this case?  If not case 4
> is
> > the
> > same as case 2.
>
> Yep, it is the same as case 2. Except it proves that Cactus is not using
> the Logger anywhere in its code (as the log4j.jar is version 1.1.3 and
> we know from case 2/ that no other log4j classes are present in any
> other classloaders).
>
> >
> > Some suggestions:
> > A) try Cactus mailing list
>
> see above
>
> > B) Find any other log4j.jar on the system and remove it.  Try running
> > everything
> > (including WL) except your Cactus app and see if something fails.
> Perhaps
> > there
> > is an unrelated log4j instance used by a different app that's fouling
> up
> > the VM
> > somehow.
>
> I'd like that but it seems that no, there is no other log4j anywhere
> else. See above. BTW if I remove Cactus, I have nothing left ... (Cactus
> is the application I am testing using itself).
>
> > C) recompile (again) Cactus using log4j 1.1.3, rebuild your ear,
> shutdown
> > and
> > restart WL, etc etc
>
> done that thousands of time.
>
> > D) Send me the full stack trace when it bombs.
> >
>
> will do.
>
> Thanks
> -Vincent
>
>
> > Vincent Massol wrote:
> >
> > > Following the thread "org/apache/log4j/Logger NoClassDefFoundError
> with
> > > version 1.1.3" here are my findings (and more questions) :
> > >
> > > 1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1
> SP2
> > > 2/ I tested the following structure :
> > >
> > > myear.ear
> > >   |_ mywar.war
> > >     |_ WEB-INF/lib
> > >       |_ cactus.jar
> > >     |_ WEB-INF/classes
> > >       |_ classes called by cactus.jar
> > >
> > > This worked fine (there was no log4j.jar and cactus does not try to
> log
> > > if log4j is not in the classpath).
> > >
> > > 3/ Then I had the following structure (which is the structure I was
> > > having problem with) :
> > >
> > > myear.ear
> > >   |_ META-INF
> > >     |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
> > >   |_ log4j.jar (VERSION 1.1.3 !!)
> > >   |_ mywar.war
> > >     |_ WEB-INF/lib
> > >       |_ cactus.jar
> > >     |_ WEB-INF/classes
> > >       |_ classes called by cactus.jar
> > >
> > > This failed with the error "org/apache/log4j/Logger"
> > > NoClassDefFoundError. This means that :
> > > a/ cactus was able to "see" log4j.jar from its classloader
> > > b/ the only log4j.jar file it could see was the one under myear.ear
> and
> > > thus in version 1.1.3 !
> > >
> > > 4/ Then I tested with the following structure :
> > >
> > > myear.ear
> > >   |_ mywar.war
> > >     |_ WEB-INF/lib
> > >       |_ cactus.jar
> > >       |_ log4j.jar (VERSION 1.1.3 !!)
> > >     |_ WEB-INF/classes
> > >       |_ classes called by cactus.jar
> > >
> > > This worked fine ! This proves that Cactus is NOT using the Logger
> > > class.
> > >
> > > Question : Where does the "org/apache/log4j/Logger"
> NoClassDefFoundError
> > > comes from ?
> > >
> > > Note: It cannot come from a log4j.jar that would be in the system
> > > classpath because in step 2/ the cactus.jar would have "seen"
> log4j.jar
> > > (the webapp CL is a child of the system CL).
> > >
> > > What am I doing wrong ? :-)
> > >
> > > Thanks
> > > -Vincent
> > >
> > > --
> > > To unsubscribe, e-mail:   <mailto:log4j-user-
> > unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: <mailto:log4j-user-
> > help@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:log4j-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:log4j-user-
> > help@jakarta.apache.org>
> >
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


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


RE: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError withversion 1.1.3

Posted by Vincent Massol <vm...@octo.com>.
Kevin,

First, thanks for your help.

> -----Original Message-----
> From: Kevin Steppe [mailto:ksteppe@pacbell.net]
> Sent: 28 February 2002 20:02
> To: Log4J Users List
> Subject: Re: [The plot continues] org/apache/log4j/Logger
> NoClassDefFoundError withversion 1.1.3
> 
> Ok, I'll wade in on this one a bit:
> 
> A) Have you tried the Cactus mailing list?  This seems intimately tied
to
> Cactus.

<huge grin/>

I am the creator of Cactus (I would answer to myself on the list if I
knew the answer, though ;-) ). What I am debugging is Cactus itself !

That said, you are right, it is linked to Cactus :-)

> B) Note that if Cactus can not load the PropertyConfigurator class it
will
> pretend to be fine, but in fact do nothing (this seems like very very
> dangerous
> behvior in logging to me -- "Hey I can't actually do any logging;
instead
> I'll
> ignore it and not tell you!"  

I don't agree. This logging is purely internal to Cactus and has nothing
to do with application logging. And I wanted to make it transparent for
the user.

That said, I am changing this behaviour. The new one will be : no cactus
logging unless you tell it so.

> So my interpretation of your trials:
>     2/ As you said, log4j.jar not found, Cactus does nothing.

Yes, I know, that's why I removed my log4j.jar ! To prove that no other
log4 classes were in the classpath anywhere ! (Please reread my email
slowly).

>     3/ As you said, log4j.jar found and Cactus bombs out mysteriously

yep, that's what I'd like to know ... :-)

>     4/ Here I think Cactus is not finding log4j.jar and so it
continues.
> Are
> you getting a log file, statements, etc from this case?  If not case 4
is
> the
> same as case 2.

Yep, it is the same as case 2. Except it proves that Cactus is not using
the Logger anywhere in its code (as the log4j.jar is version 1.1.3 and
we know from case 2/ that no other log4j classes are present in any
other classloaders).

> 
> Some suggestions:
> A) try Cactus mailing list

see above

> B) Find any other log4j.jar on the system and remove it.  Try running
> everything
> (including WL) except your Cactus app and see if something fails.
Perhaps
> there
> is an unrelated log4j instance used by a different app that's fouling
up
> the VM
> somehow.

I'd like that but it seems that no, there is no other log4j anywhere
else. See above. BTW if I remove Cactus, I have nothing left ... (Cactus
is the application I am testing using itself).

> C) recompile (again) Cactus using log4j 1.1.3, rebuild your ear,
shutdown
> and
> restart WL, etc etc

done that thousands of time.

> D) Send me the full stack trace when it bombs.
> 

will do.

Thanks
-Vincent


> Vincent Massol wrote:
> 
> > Following the thread "org/apache/log4j/Logger NoClassDefFoundError
with
> > version 1.1.3" here are my findings (and more questions) :
> >
> > 1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1
SP2
> > 2/ I tested the following structure :
> >
> > myear.ear
> >   |_ mywar.war
> >     |_ WEB-INF/lib
> >       |_ cactus.jar
> >     |_ WEB-INF/classes
> >       |_ classes called by cactus.jar
> >
> > This worked fine (there was no log4j.jar and cactus does not try to
log
> > if log4j is not in the classpath).
> >
> > 3/ Then I had the following structure (which is the structure I was
> > having problem with) :
> >
> > myear.ear
> >   |_ META-INF
> >     |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
> >   |_ log4j.jar (VERSION 1.1.3 !!)
> >   |_ mywar.war
> >     |_ WEB-INF/lib
> >       |_ cactus.jar
> >     |_ WEB-INF/classes
> >       |_ classes called by cactus.jar
> >
> > This failed with the error "org/apache/log4j/Logger"
> > NoClassDefFoundError. This means that :
> > a/ cactus was able to "see" log4j.jar from its classloader
> > b/ the only log4j.jar file it could see was the one under myear.ear
and
> > thus in version 1.1.3 !
> >
> > 4/ Then I tested with the following structure :
> >
> > myear.ear
> >   |_ mywar.war
> >     |_ WEB-INF/lib
> >       |_ cactus.jar
> >       |_ log4j.jar (VERSION 1.1.3 !!)
> >     |_ WEB-INF/classes
> >       |_ classes called by cactus.jar
> >
> > This worked fine ! This proves that Cactus is NOT using the Logger
> > class.
> >
> > Question : Where does the "org/apache/log4j/Logger"
NoClassDefFoundError
> > comes from ?
> >
> > Note: It cannot come from a log4j.jar that would be in the system
> > classpath because in step 2/ the cactus.jar would have "seen"
log4j.jar
> > (the webapp CL is a child of the system CL).
> >
> > What am I doing wrong ? :-)
> >
> > Thanks
> > -Vincent
> >
> > --
> > To unsubscribe, e-mail:   <mailto:log4j-user-
> unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:log4j-user-
> help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-
> help@jakarta.apache.org>
> 




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


Re: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError withversion 1.1.3

Posted by Kevin Steppe <ks...@pacbell.net>.
Ok, I'll wade in on this one a bit:

A) Have you tried the Cactus mailing list?  This seems intimately tied to
Cactus.
B) Note that if Cactus can not load the PropertyConfigurator class it will
pretend to be fine, but in fact do nothing (this seems like very very dangerous
behvior in logging to me -- "Hey I can't actually do any logging; instead I'll
ignore it and not tell you!"  So my interpretation of your trials:
    2/ As you said, log4j.jar not found, Cactus does nothing.
    3/ As you said, log4j.jar found and Cactus bombs out mysteriously
    4/ Here I think Cactus is not finding log4j.jar and so it continues.  Are
you getting a log file, statements, etc from this case?  If not case 4 is the
same as case 2.

Some suggestions:
A) try Cactus mailing list
B) Find any other log4j.jar on the system and remove it.  Try running everything
(including WL) except your Cactus app and see if something fails.  Perhaps there
is an unrelated log4j instance used by a different app that's fouling up the VM
somehow.
C) recompile (again) Cactus using log4j 1.1.3, rebuild your ear, shutdown and
restart WL, etc etc
D) Send me the full stack trace when it bombs.

Vincent Massol wrote:

> Following the thread "org/apache/log4j/Logger NoClassDefFoundError with
> version 1.1.3" here are my findings (and more questions) :
>
> 1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1 SP2
> 2/ I tested the following structure :
>
> myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This worked fine (there was no log4j.jar and cactus does not try to log
> if log4j is not in the classpath).
>
> 3/ Then I had the following structure (which is the structure I was
> having problem with) :
>
> myear.ear
>   |_ META-INF
>     |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
>   |_ log4j.jar (VERSION 1.1.3 !!)
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This failed with the error "org/apache/log4j/Logger"
> NoClassDefFoundError. This means that :
> a/ cactus was able to "see" log4j.jar from its classloader
> b/ the only log4j.jar file it could see was the one under myear.ear and
> thus in version 1.1.3 !
>
> 4/ Then I tested with the following structure :
>
> myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>       |_ log4j.jar (VERSION 1.1.3 !!)
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This worked fine ! This proves that Cactus is NOT using the Logger
> class.
>
> Question : Where does the "org/apache/log4j/Logger" NoClassDefFoundError
> comes from ?
>
> Note: It cannot come from a log4j.jar that would be in the system
> classpath because in step 2/ the cactus.jar would have "seen" log4j.jar
> (the webapp CL is a child of the system CL).
>
> What am I doing wrong ? :-)
>
> Thanks
> -Vincent
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


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


Re: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError with version 1.1.3

Posted by T Master <tm...@iknowledge.com>.
in yout startup batch script for WL 6.1 sp2,
specify:
     set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar
    echo %CLASSPATH

This would rmove any doubt of the system classpath.

After warring and earing... unzip them all. and hunt for log4j.jar

an idea......

[the plot thickens..]

----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>
To: "'Log4J Users List'" <lo...@jakarta.apache.org>
Sent: Wednesday, February 27, 2002 5:11 PM
Subject: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError with
version 1.1.3


> Following the thread "org/apache/log4j/Logger NoClassDefFoundError with
> version 1.1.3" here are my findings (and more questions) :
>
> 1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1 SP2
> 2/ I tested the following structure :
>
> myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This worked fine (there was no log4j.jar and cactus does not try to log
> if log4j is not in the classpath).
>
> 3/ Then I had the following structure (which is the structure I was
> having problem with) :
>
> myear.ear
>   |_ META-INF
>     |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
>   |_ log4j.jar (VERSION 1.1.3 !!)
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This failed with the error "org/apache/log4j/Logger"
> NoClassDefFoundError. This means that :
> a/ cactus was able to "see" log4j.jar from its classloader
> b/ the only log4j.jar file it could see was the one under myear.ear and
> thus in version 1.1.3 !
>
> 4/ Then I tested with the following structure :
>
> myear.ear
>   |_ mywar.war
>     |_ WEB-INF/lib
>       |_ cactus.jar
>       |_ log4j.jar (VERSION 1.1.3 !!)
>     |_ WEB-INF/classes
>       |_ classes called by cactus.jar
>
> This worked fine ! This proves that Cactus is NOT using the Logger
> class.
>
> Question : Where does the "org/apache/log4j/Logger" NoClassDefFoundError
> comes from ?
>
> Note: It cannot come from a log4j.jar that would be in the system
> classpath because in step 2/ the cactus.jar would have "seen" log4j.jar
> (the webapp CL is a child of the system CL).
>
> What am I doing wrong ? :-)
>
> Thanks
> -Vincent
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


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


RE: [The plot continues] org/apache/log4j/Logger NoClassDefFoundError with version 1.1.3

Posted by defaultuser <de...@hotmail.com>.
Just curious...what if in example one you make this change change to
your LogService()....

Class.forName("org.apache.log4j.PropertyConfigurator");        
to
Class.forName("org.apache.log4j.Category");        

2/ Should still get the nothing happens.  
(I am not convinced that you are rid of 1.2 yet :-) )

Maybe somewhere there is a Category class hanging around somewhere...
After that..try...
Object o = Class.forName("org.apache.log4j.Category").newInstance();

and
Object o =
Class.forName("org.apache.log4j.PropertyConfigurator").newInstance();


I think the first one may fail but you could put a
static { out.println(" Version 1.1.3"); } in your 1.1.3 classes to make
sure you really are loading the right version..

If I am speaking crazy talk it's because it's 2.40am and I don't work
nights and I am a total hack.

With regard to what you are doing wrong...it usually starts when you
listen to people like me :-) 

John

-----Original Message-----
From: Vincent Massol [mailto:vmassol@octo.com] 
Sent: Wednesday, February 27, 2002 7:11 PM
To: 'Log4J Users List'
Subject: [The plot continues] org/apache/log4j/Logger
NoClassDefFoundError with version 1.1.3

2/ I tested the following structure :

myear.ear
  |_ mywar.war
    |_ WEB-INF/lib
      |_ cactus.jar
    |_ WEB-INF/classes
      |_ classes called by cactus.jar

This worked fine (there was no log4j.jar and cactus does not try to log
if log4j is not in the classpath).


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


[The plot continues] org/apache/log4j/Logger NoClassDefFoundError with version 1.1.3

Posted by Vincent Massol <vm...@octo.com>.
Following the thread "org/apache/log4j/Logger NoClassDefFoundError with
version 1.1.3" here are my findings (and more questions) :

1/ I am using Log4j in a WAR application (inside an EAR) in WL 6.1 SP2
2/ I tested the following structure :

myear.ear
  |_ mywar.war
    |_ WEB-INF/lib
      |_ cactus.jar
    |_ WEB-INF/classes
      |_ classes called by cactus.jar

This worked fine (there was no log4j.jar and cactus does not try to log
if log4j is not in the classpath).

3/ Then I had the following structure (which is the structure I was
having problem with) :

myear.ear
  |_ META-INF
    |_ manifest.mf (contains a CLASS-PATH: log4j.jar)
  |_ log4j.jar (VERSION 1.1.3 !!)
  |_ mywar.war
    |_ WEB-INF/lib
      |_ cactus.jar
    |_ WEB-INF/classes
      |_ classes called by cactus.jar

This failed with the error "org/apache/log4j/Logger"
NoClassDefFoundError. This means that :
a/ cactus was able to "see" log4j.jar from its classloader
b/ the only log4j.jar file it could see was the one under myear.ear and
thus in version 1.1.3 !

4/ Then I tested with the following structure :

myear.ear
  |_ mywar.war
    |_ WEB-INF/lib
      |_ cactus.jar
      |_ log4j.jar (VERSION 1.1.3 !!)
    |_ WEB-INF/classes
      |_ classes called by cactus.jar

This worked fine ! This proves that Cactus is NOT using the Logger
class.

Question : Where does the "org/apache/log4j/Logger" NoClassDefFoundError
comes from ?

Note: It cannot come from a log4j.jar that would be in the system
classpath because in step 2/ the cactus.jar would have "seen" log4j.jar
(the webapp CL is a child of the system CL).

What am I doing wrong ? :-)

Thanks
-Vincent



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


RE: org/apache/log4j/Logger NoClassDefFoundError with version 1.1.3

Posted by Vincent Massol <vm...@octo.com>.
Thanks Tim. I know that. The problem is that I'm not using the Logger
class, only the Category one.

Here are the 3 classes involved. The exception is reported at line 181
in LogService.java ("log = new BaseLog(theCategoryName);") and
BaseLog.java only uses the Category class.

Thanks

Cheers,
-Vincent

> -----Original Message-----
> From: Tim Wei [mailto:Tim.Wei@telus.com]
> Sent: 27 February 2002 22:32
> To: 'Log4J Users List'
> Subject: RE: org/apache/log4j/Logger NoClassDefFoundError with version
> 1.1.3
> 
> Now Logger in the 1.1.3 version. You have to user Category class.
> 
> Logger is in the beta version.
> 
> > -----Original Message-----
> > From:	Vincent Massol [SMTP:vmassol@octo.com]
> > Sent:	Wednesday, February 27, 2002 5:15 PM
> > To:	log4j-user@jakarta.apache.org
> > Subject:	org/apache/log4j/Logger NoClassDefFoundError with
version
> > 1.1.3
> >
> > Hi,
> >
> > I am having a strange problem that I'm failing to resolve on my own.
It
> > appears I'm not the only one as several other persons have also
reported
> > it to me.
> >
> > The contenders are Log4J 1.1.3, Log4J 1.2 and Cactus.
> >
> > * When I run Cactus with log4j 1.1.3 in the classpath, I get a
> > "org/apache/log4j/Logger" NoClassDefFoundError.
> > * The problem is that in Cactus I do not use anything else than the
> > Log4J Category class.
> > * To ensure this, I am even building the Cactus jar with log4J
1.1.3.
> >
> > This is driving me crazy ;-). Obviously, at first glance, you would
say
> > that one of the 3 assertions above has to be false, right ? The
problem
> > is that I have checked and rechecked several times (asking the help
of
> > others too) and I still cannot see what's wrong.
> >
> > Any idea, hint, RTFM, have some fresh air, etc ?
> >
> > Thanks
> > -Vincent
> >
> > P.S.: I realize it is certainly a fault on my side. However, I'm
> > completely stuck and others have been reporting same kinds of errors
> > (using Cactus).
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-
> help@jakarta.apache.org>
>