You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Joerg Hohwiller <jo...@j-hohwiller.de> on 2005/10/01 01:49:34 UTC

Re: [logging] tests

-----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


Re: [logging] tests

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Sat, 2005-10-01 at 22:13 +0200, Joerg Hohwiller wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Simon,
> 
> Simon Kitching wrote:
> > On Sat, 2005-10-01 at 02:47 +0200, Joerg Hohwiller wrote:
> > 
> >>As I have checked with offical releases ant seems
> >>to be the master and maven is just there for other reasons (maybe the site
> >>generation).
> > 
> > 
> > Yes, this is the case. 
> > 
> > Up until now, commons-logging has always been built with Ant, with Maven
> > just used for the website.

it's actually worse than this: all the releases that i've cut have
needed to be adjusted manually. this isn't good.
 
<snip>

> >>For me the question is:
> >>Is the API-jar build in maven.xml just legacy and can be kicked out?
> >>Or on the other hand has someone evaluated if the test issue can be solved with
> >>a recent maven version and the ant can be replaced and kicked out?
> > 
> > 
> > As you may have seen, the way unit testing is done has undergone a
> > radical revision (by me). It was extremely convoluted before, and is
> > hopefully now saner. I hoped that one of the outcomes was to be able to
> > build/test from maven, but the log4j incompatibility issues then blew
> > that goal out of the water again.

the unit tests are *much* better now
 
> > And unfortunately 2 months ago I ran out of time for working on
> > commons-logging (combination of new relationship and new job; need 25
> > hours in the day *without* any open-source work!).
> Thanks for making this clear.

+1
 
> > If you think you can get this application building with Maven, then
> > please have a go. It will be a challenge.
> We'll the only idea I have right now is to add (fictive) subprojects for the two
> log4j versions. That might be an easy solution. 

we've discussed aggressively splitting JCL into separate builds before.
there are significant disadvantages but also advantages. 

> My time is also very
> limitted, but I will give it a try to play around and we'll see.

i'm a little intrigued by the idea of fictive subprojects and look
forward to seeing the results. 

> Anyways I hope there is anybody left from commons-logging for my
> "getChildLogger" proposal. I am very keen on that.
> If someone would have a look at it and let me know what else to do to make it
> happen to be committed, I would be very pleased.
> I already added a test for the new Logger features within the patch.
> I would write additional information and potential FAQ entries.
> But at the current moment I get very few feedback at all about what I want and
> think. So I do not have a clue if my patch will be accepted.

thanks for your patience. i'll try to take a look at the patch this
weekend.

- robert


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


Re: [logging] tests

Posted by Joerg Hohwiller <jo...@j-hohwiller.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Simon,

Simon Kitching wrote:
> On Sat, 2005-10-01 at 02:47 +0200, Joerg Hohwiller wrote:
> 
>>As I have checked with offical releases ant seems
>>to be the master and maven is just there for other reasons (maybe the site
>>generation).
> 
> 
> Yes, this is the case. 
> 
> Up until now, commons-logging has always been built with Ant, with Maven
> just used for the website.
> 
> After the last release I put some significant work into trying to use
> Maven to build and test commons-logging. However the situation where we
> need to bundle loggers for log4j12 and log4j13 but these two libraries
> are binary-incompatible makes it even harder to use Maven.
> 
> Unfortunately, the result of my work is that the maven build initially
> looks like it might be usable, but actually isn't. I really should strip
> out all the code that even attempts to build the release jar.
> 
> 
> 
>>For me the question is:
>>Is the API-jar build in maven.xml just legacy and can be kicked out?
>>Or on the other hand has someone evaluated if the test issue can be solved with
>>a recent maven version and the ant can be replaced and kicked out?
> 
> 
> As you may have seen, the way unit testing is done has undergone a
> radical revision (by me). It was extremely convoluted before, and is
> hopefully now saner. I hoped that one of the outcomes was to be able to
> build/test from maven, but the log4j incompatibility issues then blew
> that goal out of the water again.
> 
> And unfortunately 2 months ago I ran out of time for working on
> commons-logging (combination of new relationship and new job; need 25
> hours in the day *without* any open-source work!).
Thanks for making this clear.
> 
> If you think you can get this application building with Maven, then
> please have a go. It will be a challenge.
We'll the only idea I have right now is to add (fictive) subprojects for the two
log4j versions. That might be an easy solution. My time is also very
limitted, but I will give it a try to play around and we'll see.

Anyways I hope there is anybody left from commons-logging for my
"getChildLogger" proposal. I am very keen on that.
If someone would have a look at it and let me know what else to do to make it
happen to be committed, I would be very pleased.
I already added a test for the new Logger features within the patch.
I would write additional information and potential FAQ entries.
But at the current moment I get very few feedback at all about what I want and
think. So I do not have a clue if my patch will be accepted.
> 
> Regards,
> 
> Simon
Regards
  Jörg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDPu3hmPuec2Dcv/8RAtyLAJ0RU6aWxqbWeol+3sIZVhBE9aGu3ACcDdAI
1xAcqnpMhGo4lAGg8sMcSxM=
=oXbU
-----END PGP SIGNATURE-----

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


Re: [logging] tests

Posted by Simon Kitching <sk...@apache.org>.
On Sat, 2005-10-01 at 02:47 +0200, Joerg Hohwiller wrote:
> As I have checked with offical releases ant seems
> to be the master and maven is just there for other reasons (maybe the site
> generation).

Yes, this is the case. 

Up until now, commons-logging has always been built with Ant, with Maven
just used for the website.

After the last release I put some significant work into trying to use
Maven to build and test commons-logging. However the situation where we
need to bundle loggers for log4j12 and log4j13 but these two libraries
are binary-incompatible makes it even harder to use Maven.

Unfortunately, the result of my work is that the maven build initially
looks like it might be usable, but actually isn't. I really should strip
out all the code that even attempts to build the release jar.


> For me the question is:
> Is the API-jar build in maven.xml just legacy and can be kicked out?
> Or on the other hand has someone evaluated if the test issue can be solved with
> a recent maven version and the ant can be replaced and kicked out?

As you may have seen, the way unit testing is done has undergone a
radical revision (by me). It was extremely convoluted before, and is
hopefully now saner. I hoped that one of the outcomes was to be able to
build/test from maven, but the log4j incompatibility issues then blew
that goal out of the water again.

And unfortunately 2 months ago I ran out of time for working on
commons-logging (combination of new relationship and new job; need 25
hours in the day *without* any open-source work!).

If you think you can get this application building with Maven, then
please have a go. It will be a challenge.

Regards,

Simon


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


Re: [logging] tests

Posted by Joerg Hohwiller <jo...@j-hohwiller.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,
> [snip]
> 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.
> [snip]
Just to point this out: the API jar already contained the AbstractLogger class
when it was build with maven. The maven build process is a very different animal
and especially the ant build says in the API jar comes exactly what is specified
by includes while the maven.xml says in the API jar comes everyting except some
classes.
The result completely differs. As I have checked with offical releases ant seems
to be the master and maven is just there for other reasons (maybe the site
generation).
I think this is not really nice but in this situation hard to maintain.
If the maven can build the api jar at all it should do right in my oppinion.
For maintainance the redundancy could be avoided by having one XML snipplet for
that logic and include it within and and maven. The tradeoff is a more
complicated situation.

For me the question is:
Is the API-jar build in maven.xml just legacy and can be kicked out?
Or on the other hand has someone evaluated if the test issue can be solved with
a recent maven version and the ant can be replaced and kicked out?

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

iD8DBQFDPdy5mPuec2Dcv/8RAn0jAJ9vDx6Bxfoc5LJrikcEGy7Ini3zDQCfWhe2
QZmy9prqxEUCMFhvFMCZ6Gk=
=u2+H
-----END PGP SIGNATURE-----

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