tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chan, Kam Yuen" <KC...@rgare.com>
Subject RE: Using jdk1.4 logger problem
Date Fri, 12 Sep 2003 22:37:21 GMT
Moving the the jar over to endorsed helped. But I am still having some problems.

In short, our application is packaged up in 4 jars, plus some third party library jars. 
One of the jar is the framework jar, which contains the logger classes. 
Another jar contains classes for the Servlet's and JSP's to use.
Two other jars contain the "back end" application  ("application jars").

Ideally, I would like to place all these jars in the WEB-INF/lib directory (or some place
that is not "common"). Based on Bill's suggestion, I moved the framework jar over to endorsed,
and the CL can now find the logger classes.

During one of servlet initialization, we initializes a bunch of "back end" stuff, which uses
classes in the "application jars". 

Here is the problem. Classes in the servlet jar has no problem. But all the classes in the
"application jar" is still causing ClassNotFoundException, during this initialization.  This
is evern after Tomcat's log said the jar was deployed. 

Any help is much appreciated.

Kam Chan

-----Original Message-----
From: Bill Barker [mailto:wbarker@wilshire.com]
Sent: Thursday, September 04, 2003 10:17 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Using jdk1.4 logger problem



"Chan, Kam Yuen" <KChan@rgare.com> wrote in message
news:EB1A6A7DCB06804195592EF1716F15B50405AADB@rgaexmail.rgare.com...
> Hello,
>
> I am trying to load our App in Tomcat.
> One of the initialization is being done by a Servlet, which is set to
autoload. During this initialization, we also initializes the logger, which
are subclasses of the JDK1.4 logger classes.
>
> But, some how the logger manager can't find the handler classes. (Class
loader problem?)

Yup, it's a CL problem.  Unfortunately, it looks like the problem is in
Sun's implementation of 1.4 Logging.  Instead of using the
ContextClassLoader, it's looking for your class in the AppClassLoader
(which, of course, knows nothing about your class :).

At the moment, the only work-around I can see is to place your jar in
$CATALINA_HOME/common/endorsed.  Of course, if it will make you feel better,
you can also b*tch at Sun for not designing their Logging implementation in
a way that is friendly to app-servers ;-).

>
> Please see below the stack trace.  You will see that the
resoft.framework.logging.DBHandler is the class that can't be found. But it
is in the same package and jar as the resoft.framework.logging.ResoftLogger,
which was invoked in the middle of the stack.
>
> The jar is placed in the WEB-INF/lib directory.
>
> Thanks in advance for your Help.
>
> Kam Chan
>

Mime
View raw message