[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    RE: Problem Using Log4J and Commons Logging with Struts
From:       pqin () shareowner ! com
Date:       2002-12-30 22:21:34
[Download RAW message or body]


Sorry, I am talking about Tomcat. Maybe it is bug for JRun.

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-----Original Message-----
From: Paul Hodgetts [mailto:phodgetts@agilelogic.com] 
Sent: December 30, 2002 5:14 PM
To: struts-user@jakarta.apache.org
Subject: Re: Problem Using Log4J and Commons Logging with Struts

Phillip Qin wrote:

 > If I only use log4j, jar has to be placed in my app's WEB-INF/lib. Don't
 > know why it is in a different directory if commons-logging and log4j work
 > together.

Just because two libraries use each other's classes doesn't mean
their classes (or jars) need to be in the same directory.  They
just need to locate each other's classes in the classpath.

A web container places WEB-INF/classes and all the jars found in
WEB-INF/lib into the classpath for the web application.  I don't
know for sure (I haven't researched the specs), but apparently
these are supposed to be placed in the classpath prior to
initializing the web application.

JRun apparently has a bug where it does not put these in the
classpath early enough, so when some components of Struts (or
something else that depends on Log4J) initialize, they can't
find the Log4J jar file, and hence the NoClassDefFoundError.

It probably works for you to just put the Log4J jar into
WEB-INF/lib under a different container, and I'd really like it
to work this way for JRun as well, but it doesn't, so I need to
put the Log4J jar and properties file into the shared server lib
directory (jrun/servers/lib) for it to work.

That is why it is in a different directory.

Regards,
Paul
-----
Paul Hodgetts -- President, Principal Consultant
Agile Logic -- www.agilelogic.com
Consulting, Coaching, Training -- On-Site & Out-Sourced Development
Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic