You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kell Sønnichsen <ke...@uni-c.dk> on 2002/11/11 14:47:08 UTC

Xdoclet drowning in log4j DEBUG messages

Hi all,

We have a project where the 'xdoclet' target is spinning out of control
with megabytes of debug messages from log4j. This means that the target
takes about 20 minutes to finish!

The target is specified like this:

<target name="xdoclet">
  <taskdef
     name="ejbdoclet"
     classname="xdoclet.ejb.EjbDocletTask"
     classpathref="compile.class.path"
  />
  <ejbdoclet
    sourcepath="${ejb.src}"
    destdir="${xdoclet.src}"
    excludedtags="@version,@author"
    ejbspec="2.0"
    classpathref="compile.class.path"
  >
    <packageSubstitution packages="ejb" substituteWith="interfaces"/>
    ...
  </ejbdoclet>
</target>

I don't know whether it is a xdoclet problem or an ant problem but I
have tried to find a way to tell log4j where to find it's configuration
file. And _that_ is an ant problem. How do I deliver a property file
through the layers ant -> xdoclet -> log4j ?

Alternatively, does anybody know how to make xdoclet/log4j shut up in
another way than specifying it in an log4j.properties file?

We are using:
- Linux 2.4 (debian)
- Ant 1.5
- Xdoclet 1.2.0b1 (but also 1.1.2 had the problem)
- Log4j 1.2.6


Regards,
/Kell Sønnichsen.
-- 
>>  Kell Soennichsen, UNI-C, Olof Palmes Alle 38, DK-8200 Aarhus N.  <<
>>  phone: +45 8937 6666 / +45 8937 6674, fax: +45 8937 6677         <<
>>  email: kell.sonnichsen@uni-c.dk, http://www.uni-c.dk             <<
>>    Codito, ergo sum - I code, therefore I am                      <<



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


Re: Xdoclet drowning in log4j DEBUG messages

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Kell Sønnichsen wrote:
> We are both right :-) I cut-and-pasted the above _before_ I upgraded to
> Xdoclet 1.2b1. But the problem persists. The only change is in the
> classname, right?:
>           classname="xdoclet.modules.ejb.EjbDocletTask"

And where you put the classpath/classpathref/<classpath> stuff.  1.2 of 
XDoclet makes you put it on the <taskdef>, and its illegal on 
<ejbdoclet> now.

> I have tried 'ant -Dlog4j.properties=log4jconf.xml ...' but even though
> the property does get set it seems to have no effect. I believe
> that Xdoclet doesn't read the system property so it is not set for
> log4j?
> If I remove log4j.jar (or the equivalent) it simply complains:

I believe its -Dlog4j.configuration=....

*not* -Dlog4j.properties.  But this is a Log4j issue, not an Ant one, so 
refer to their docs, or take this up on the xdoclet-devel list from here 
on out since we're out of it being an Ant issue :))

	Erik


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


Re: Xdoclet drowning in log4j DEBUG messages

Posted by Kell Sønnichsen <ke...@uni-c.dk>.
On Mon, 11 Nov 2002, Erik Hatcher wrote:

> Kell Sønnichsen wrote:
> > <target name="xdoclet">
> >   <taskdef
> >      name="ejbdoclet"
> >      classname="xdoclet.ejb.EjbDocletTask"
> >      classpathref="compile.class.path"
> >   />
> >   <ejbdoclet
> >     sourcepath="${ejb.src}"
> >     destdir="${xdoclet.src}"
> >     excludedtags="@version,@author"
> >     ejbspec="2.0"
> >     classpathref="compile.class.path"
> >   >
> >     <packageSubstitution packages="ejb" substituteWith="interfaces"/>
> >     ...
> >   </ejbdoclet>
> > </target>
>
>  From the above it is clear you are using XDoclet < 1.2, so I'd first
> recomment you upgrade to XDoclet 1.2beta1 (or beta2, which will be out
> soon, if not already).
>
We are both right :-) I cut-and-pasted the above _before_ I upgraded to
Xdoclet 1.2b1. But the problem persists. The only change is in the
classname, right?:
          classname="xdoclet.modules.ejb.EjbDocletTask"

> You can set ANT_OPTS to be "-Dlog4j.configuration=<path to
> log4j.properties>" perhaps to make this better?  Or just simply remove
> log4j.jar from your Ant operating classpath (why do you need it there
> anyway?)
>
I have tried 'ant -Dlog4j.properties=log4jconf.xml ...' but even though
the property does get set it seems to have no effect. I believe
that Xdoclet doesn't read the system property so it is not set for
log4j?
If I remove log4j.jar (or the equivalent) it simply complains:

xdoclet:

BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory


> > - Xdoclet 1.2.0b1 (but also 1.1.2 had the problem)
>
> I do not believe you're using 1.2.0b1 otherwise the above Ant syntax
> (the classpath on ejbdoclet) would fail since that is no longer
> supported.

You got me there :-)


Regards,
/Kell.
-- 
>>  Kell Soennichsen, UNI-C, Olof Palmes Alle 38, DK-8200 Aarhus N.  <<
>>  phone: +45 8937 6666 / +45 8937 6674, fax: +45 8937 6677         <<
>>  email: kell.sonnichsen@uni-c.dk, http://www.uni-c.dk             <<
>>    Codito, ergo sum - I code, therefore I am                      <<


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


Re: Xdoclet drowning in log4j DEBUG messages

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Kell Sønnichsen wrote:
> <target name="xdoclet">
>   <taskdef
>      name="ejbdoclet"
>      classname="xdoclet.ejb.EjbDocletTask"
>      classpathref="compile.class.path"
>   />
>   <ejbdoclet
>     sourcepath="${ejb.src}"
>     destdir="${xdoclet.src}"
>     excludedtags="@version,@author"
>     ejbspec="2.0"
>     classpathref="compile.class.path"
>   >
>     <packageSubstitution packages="ejb" substituteWith="interfaces"/>
>     ...
>   </ejbdoclet>
> </target>

 From the above it is clear you are using XDoclet < 1.2, so I'd first 
recomment you upgrade to XDoclet 1.2beta1 (or beta2, which will be out 
soon, if not already).

> I don't know whether it is a xdoclet problem or an ant problem but I
> have tried to find a way to tell log4j where to find it's configuration
> file. And _that_ is an ant problem. How do I deliver a property file
> through the layers ant -> xdoclet -> log4j ?

Its not an Ant problem.  I believe Log4j will get its configuration from 
the classpath or from a log4j.configuration system property (I could be 
wrong on this, but its something along these lines).  Logging is always 
a bit of a pain in my experience so its fiddly to get configured 
properly, but in no way is this an Ant problem.

You can set ANT_OPTS to be "-Dlog4j.configuration=<path to 
log4j.properties>" perhaps to make this better?  Or just simply remove 
log4j.jar from your Ant operating classpath (why do you need it there 
anyway?)

> Alternatively, does anybody know how to make xdoclet/log4j shut up in
> another way than specifying it in an log4j.properties file?
> 
> We are using:
> - Linux 2.4 (debian)
> - Ant 1.5
> - Xdoclet 1.2.0b1 (but also 1.1.2 had the problem)

I do not believe you're using 1.2.0b1 otherwise the above Ant syntax 
(the classpath on ejbdoclet) would fail since that is no longer 
supported.  At least that is my understanding of the changes that were 
made.  Could you double-check which XDoclet you're using?

	Erik


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