You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jens Kühnberger <Ku...@web.de> on 2002/07/27 10:31:48 UTC

avalon-framework lib in distribution

Hi,

I want to use log4j to log the fop messages I get from the Driver.

I implemented it like this:

import org.apache.avalon.framework.logger.Logger;
import org.apache.avalon.framework.logger.Log4JLogger;

...

    org.apache.log4j.Category cat = 
org.apache.log4j.Category.getInstance(my.class);

...

       Driver driver = new Driver();
       Logger log = new Log4JLogger(cat);
       driver.setLogger(log);
       driver.setRenderer(driver.RENDER_PDF);
       driver.setOutputStream(out);
       driver.render(doc);

and get the following error:

java.lang.NoClassDefFoundError: 
org/apache/avalon/framework/logger/ConsoleLogger
	at org.apache.fop.messaging.MessageHandler.log(Unknown Source)
	at org.apache.fop.messaging.MessageHandler.logln(Unknown Source)
	at org.apache.fop.render.pdf.FontSetup.setup(Unknown Source)
	at org.apache.fop.render.PrintRenderer.setupFontInfo(Unknown Source)
	at org.apache.fop.apps.StreamRenderer.startRenderer(Unknown Source)
	at org.apache.fop.fo.FOTreeBuilder.startDocument(Unknown Source)
	at org.apache.fop.tools.DocumentReader.parse(Unknown Source)
	at org.apache.fop.apps.Driver.render(Unknown Source)
	at org.apache.fop.apps.Driver.render(Unknown Source)
	at com.timesoft.report.my.renderFO(my.java:108)

when I'm using the avalon-framwork-4.1.2.jar. The problem with the 
avalon-framework-cvs-20020315.jar that comes with the 
fop-0.20.4-bin.tar.gz is, that it doesn't have the 
org.apache.avalon.framework.logger.Log4JLogger class.

(in my.java:108 I do driver.render(doc); )

Any suggestions?

Jens


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: avalon-framework lib in distribution

Posted by Michael Gratton <mj...@recalldesign.com>.
Hi Jens,

I built avalon-framework-cvs-20020315.jar from the Framework codebase in 
CVS (pulled on the date of the jar file) because at the time, the 
current release was too out of date. Unfortunately, I think there still 
hasn't been another release yet.

Jens Kühnberger wrote:
> java.lang.NoClassDefFoundError: org/apache/avalon/framework/logger/ConsoleLogger
> [snip]
> when I'm using the avalon-framwork-4.1.2.jar.

You'll get the NoClassDefFoundError when using avalon-framwork-4.1.2.jar 
because it doesn't contain the afore-mentioned up-to-date code.

> The problem with the 
> avalon-framework-cvs-20020315.jar that comes with the 
> fop-0.20.4-bin.tar.gz is, that it doesn't have the 
> org.apache.avalon.framework.logger.Log4JLogger class.

The Log4JLogger probably wasn't built becuase Log4J would not have been 
found when I was compiling the Framework codebase.

The solution would be to pull the Framework source code, make sure Log4J 
is on your CLASSPATH, and build it. Use the resulting jar instead of 
both avalon-framework-cvs-20020315.jar and avalon-framwork-4.1.2.jar and 
you should be fine.

HTH,
/mike

-- 
Michael Gratton <mj...@recalldesign.com>
Recall Design <http://www.recalldesign.com/>
s: 53 Gilbert Street Adelaide SA 5000 Australia
t: +61 8 8217 0500 f: +61 8 8217 0555