commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Hohwiller <jo...@j-hohwiller.de>
Subject Re: [logging] tests
Date Fri, 30 Sep 2005 23:49:34 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

I debugged deep into and found the problem:
The testcase seems to create an own classloader and load the minimal classes
(jcl-api and -tests) for the test with that. Next it tries to get the Logger
instance via the LogFactory. Since it is not explicitly configured it looks for
the loggers defined in the code as fallback.
Because the additional loggers not included in the jdk are not in the classpath,
so these fallbacks (log4j) can not work. Next favorite is the JDK14Logger.
This should be available and that is what the test expects with the assert
statement.
Now, with my extension this does not work as expected.
So why is that?
Here is the answer:
java.lang.NoClassDefFoundError: org/apache/commons/logging/impl/AbstractLogger

This is the abstract base class that I invented and that all
logger-implementations extend.

So the failure of the test tells me, that this class must be part of the
commons-logging-api*.jar what is very true and really clever that the test
pointed this out :)

Now the big question was:
Why can it load the Lumberjack Logger then?
This is because it is in a separate jar (commons-logging-impl*.jar) that
contains the AbstractLogger and the Lumberjack Logger while the JDK14Logger
is in the api jar that is missing this class.

So I will adopt the build-process so the AbstractLogger will be included in the
API jar. I suppose I have to do this in the ant and in the maven build
configuration.

As soon as I am done and all works fine, I will supply the patch to the
according bugzilla issue.

Regards
  Jörg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDPc8OmPuec2Dcv/8RAh//AKCKwMkHlfJ7ny9xSNKzEq1A8tx3dQCbBIDi
Zg8qx9kR4QnPDFBBL8EE8cc=
=JPaz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message