Michael Gratton | 13 Mar 2002 01:08

Re: Using Avalon/Logkit


Keiron Liddle wrote:
> 
> I think the are three possibilities:
> - use a generic logging package such as found in avalon, it is quite 
> possible to use the LogkitLogger, Log4JLogger and Jdk14Logger

True, but it introduces a dependency on Yet Another API (YAAPI). I'm 
generalizing here, but in my experience and from what I've picked up 
from other people in similar situations, is that keeping YAAPI bloat to 
a bare minimum is highly desirable.

> - use an interface

I see this as the most flexible method.

> - use methods on the user agent

I can see that this approach would provide some flexibility, but I'd 
suggest that the UA would be useful for obtaining an instance of the 
logging interface, rather than exposing methods for doing the actual 
error reporting itself, exactly as it does at the moment.

> The interface almost guarantees that we will need extra code to do 
> things that everyone else is doing. 

I don't think the amount of extra code would be too great. It would 
require 2 additional source files right now: one for the interface, one 
for the default Logkit implementation. Both would be tiny.

(Continue reading)

Michael Gratton | 13 Mar 2002 01:35

Re: Using Avalon/Logkit


Jeremias Maerki wrote:
> Logging is one thing. Error handling (like layout problems, image that
> can't be found etc.) is another. Right
As much as it at the moment. Obviously, errors need to be reported, and 
the most convenient way to do that is via a logging mechanism. In 
addition, it's often useful if there's some sort of callback mechanism 
so that the application, whether that be Driver or some code embedding 
FOP, can decide how to continue, *if* it should continue, and 
potentially, how to log the error.

Again, I think the way SAX does this, using org.xml.sax.ErrorHandler, is 
a convenient and flexible way to go.

> Logging: I'd go for the Avalon Logger interface which lets us freely
> choose the logging backend. We can even use the new ConsoleLogger or
> even NullLogger. :-)

Fair enough, but I maintain that it's still too much work for embedders. 
It is a right pain to have to have to include two more large libraries 
(Avalon and Logkit) with your application just to let FOP do logging, 
and it's too much functionality if your application has it's own logging 
mechanism already.

I'd suggest it would be a poor move to lock FOP into using one 
particular logging mechanism, especially when there are many 
alternatives out there: Log4J, 1.4's native logging mechanism, and all 
the existing, custom jobs, many of which have rabid supporters who won't 
use anything else. 8)

(Continue reading)

Peter B. West | 13 Mar 2002 02:44
Picon
Picon

Serialization

Dear Fops,

I'm naïve about serialization (among other things.)  Can anyone tell me 
whether it is possible to serialize an instance of an inner class 
without implicitly serializing the containing class instance?

Peter

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

David B. Bitton | 13 Mar 2002 03:54

Re: userconfig.xml

Revelation:

Now I know why System.getProperties("user.dir") == "c:\windows\system32",
because that's where the Tomcat NT service must start from (not to mention
the java.exe that's in that folder also).  Hmm, what to do?  Ok, so how can
I have a not so relative path?

Conundrum:

How can I gain access to configuration info that resides in the web.xml file
for the SOAP servlet that calls my class, that in turn calls FOP?

--

David B. Bitton
david <at> codenoevil.com
www.codenoevil.com

Diversa ab illis virtute valemus.
----- Original Message -----
From: "Beer, Christian" <BEE <at> DIRON.de>
To: <fop-dev <at> xml.apache.org>
Sent: Tuesday, March 12, 2002 2:55 AM
Subject: AW: userconfig.xml

> > Yeah.  If I try File file = new File("userconfig.xml"), where
> > is it looking
> > relative to the class file requesting the file?
> >
> No, he is looking relative to the path you started java from.
(Continue reading)

Michael Gratton | 13 Mar 2002 06:54

LoggingHandler patch [was: Using Avalon/Logkit]


Guys,

To further to my suggestions about using an interface for logging in 
core FOP components, I've produced a working implementation of my 
suggestion. After a precursory test using the command line, the changes 
seem to work fine.

The patch, for the "fop-0_20_3" branch in CVS, and the two additional 
required source files are available at:

   <http://web.vee.net/fop/LoggingHandlerImpl-2002031300.jar>

The two added files are src/org/apache/fop/apps/LoggingHandler.java and 
src/org/apache/fop/apps/LogkitLoggingHandler.java. The former is the 
LoggingHandler interface, which has replaced any use of 
org.apache.log.Logger in core FOP code. The latter is an implementation 
of LoggingHandler which uses Logkit and is Loggable (for Avalon).

I've identified three applications which use assume the use of Logkit 
for logging: The command line app, the FOP task for Ant and 
TestConverter. All three have been modified to use LogkitLoggingHandler 
and hence function in the exact same fashion as before. In addition, if 
no LoggingHandler is explicitly set on Driver, it by default uses an 
instance of LogkitLoggingHandler, again to make it behave the same as 
before.

Embedders who do not wish to use Logkit for logging can write their own 
implementation of LoggingHandler and call Driver.setLogger() prior 
invoking Driver.render().
(Continue reading)

Jeremias Maerki | 13 Mar 2002 08:26
Picon

Re: Using Avalon/Logkit

Michael

> Jeremias Maerki wrote:
> > Logging is one thing. Error handling (like layout problems, image that
> > can't be found etc.) is another. Right
> As much as it at the moment. Obviously, errors need to be reported, and 
> the most convenient way to do that is via a logging mechanism. In 
> addition, it's often useful if there's some sort of callback mechanism 
> so that the application, whether that be Driver or some code embedding 
> FOP, can decide how to continue, *if* it should continue, and 
> potentially, how to log the error.
> 
> Again, I think the way SAX does this, using org.xml.sax.ErrorHandler, is 
> a convenient and flexible way to go.

Right, I think we agree here.

> > Logging: I'd go for the Avalon Logger interface which lets us freely
> > choose the logging backend. We can even use the new ConsoleLogger or
> > even NullLogger. :-)
> 
> Fair enough, but I maintain that it's still too much work for embedders. 
> It is a right pain to have to have to include two more large libraries 
> (Avalon and Logkit) with your application just to let FOP do logging, 
> and it's too much functionality if your application has it's own logging 
> mechanism already.
> 
> I'd suggest it would be a poor move to lock FOP into using one 
> particular logging mechanism, especially when there are many 
> alternatives out there: Log4J, 1.4's native logging mechanism, and all 
(Continue reading)

Jeremias Maerki | 13 Mar 2002 08:30
Picon

Re: LoggingHandler patch [was: Using Avalon/Logkit]

Michael

It's me again. I'm against that for the reasons layed out in my mail
from a few moments ago. I appreciate your effort but I think this is the
wrong way. I'm not a committer so my opinion doesn't count but I have
grown very fond of FOP to just be silent.

Cheers,
Jeremias Märki

mailto:jeremias.maerki <at> outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Tel. +41 41 317 2020 - Fax +41 41 317 2029
Internet http://www.outline.ch

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

Keiron Liddle | 13 Mar 2002 09:03

Re: Serialization

Hi Peter,

An inner class is actually a separate class that contains a reference to 
the containing class.
When the class is serialized it will serialize that reference (since I 
presume it is not transient).
If the class is static then it will not have a rreference to the 
containing class but that may not be suitable for other reasons.

On 2002.03.13 02:44 Peter B. West wrote:
> Dear Fops,
> 
> I'm naïve about serialization (among other things.)  Can anyone tell me 
> whether it is possible to serialize an instance of an inner class 
> without implicitly serializing the containing class instance?
> 
> Peter

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

Michael Gratton | 13 Mar 2002 09:26

Re: Using Avalon/Logkit


Hey Jeremias,

Jeremias Maerki wrote:
> 
> Right, I think we agree here.
> 

Cool.

> I'm exactly proposing this. I suggest you really have a look at Avalon.
> Avalon is very far from being another large library. Avalon Framework is
> 46K, LogKit is about 52K. Is that large?

Okay, my "two large libraries" remark was off-centre, but you really 
need to consider those who, for whatever reason, simply *can't* use 
Avalon. The reasons may be technical, political or otherwise, but if FOP 
forces people to use Avalon, then you will end up having people who 
won't use FOP because of it.

I'd love to have the time to get to know Avalon, but I just don't. In 
addition, the there is no way the particular project here at work I want 
to embed FOP in is going to use Avalon. Period. If the dependency on 
Avalon can't be broken, then there's very little chance FOP will be used 
for this project. Which I'll find very dissapointing, because I'm a big 
fan of FOP.

> org.apache.avalon.framework.logger.Logger is almost exactly what you did
> in your proposal, except that you introduce yet another API,

(Continue reading)

Klosa Uwe | 13 Mar 2002 11:14
Picon
Picon

SV: problems with fo:external-graphic

Hello Guillaume,
 
thanks for the tip. I had have the same problem as Michael.
For me it works now.
 
Regards
 
Uwe
-----Ursprungligt meddelande-----
Från: Guillaume Laforge [mailto:glaforge <at> reflexe.fr]
Skickat: den 12 mars 2002 17:18
Till: fop-user <at> xml.apache.org
Kopia: fop-dev <at> xml.apache.org
Ämne: Re: problems with fo:external-graphic

Hello Michael,
 
Do you still have the same problem ? (SVGDocument class not found ?)
I've got the same problem. It heavily depends on your tomcat version you are using.
A quick hack for me was to move batik.jar from my WEB-INF/lib directory to Tomcat's common/lib.
It works, but it's not very cool if you wish to make a deployable archive (a WAR file), because you have to install the WAR, AND THEN : Batik.jar in common/lib.
I think the problem comes from Tomcat itself, in the way it loads the jar files. The custom class loaders behaves totally differently between Tomcat 3.2 and Tomcat 4.0.x. And even between Tomcat 4.0.1, 2 and 3 !!!!
I dont have the problem with Tomcat 4.0.1 (jdk1.3.1 on Linux and on Windows2K) and the problem appears with Tomcat 4.0.3 on W2K. 
Did you find another solution to this problem ?
 
Guillaume
Hello all,

I have a problem with fo:external-graphic.

I use a Servlet to do PDF generation together with a test style sheet which
produces FO-code in which the following fo:external-graphic is contained:

...
<fo:external-graphic src="file:///c:/xml_space/lohnsteuer/fd_logo.gif"
height="0.58cm" width="2.71cm"/>
...

When I use this under jBuilder with integrated Apache Tomcat 3.2 to include
the GIF fd_logo.gif into the PDF everything works fine.

But: after the whole application is distributed to my stand alone Tomcat 4.0
server problems occur (see following exception).
The error occurs with FOP 0.20.2RC and with 0.20.3 also.

What's the cause for this?
What alternatives do I have?

Best regards, Michael

(exception information follows)

exception root cause...
  java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument

complete exception as follows...

type Exception report
message Internal Server Error

description The server encountered an internal error (Internal Server Error)
that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
at
...
...
...
...
root cause

java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument
at
org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFactory.jav
a:45)
at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:100)
at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:125)
at org.apache.fop.fo.flow.Block.layout(Block.java:259)
at org.apache.fop.fo.flow.TableCell.layout(TableCell.java:263)
at org.apache.fop.fo.flow.TableRow.layout(TableRow.java:344)
at org.apache.fop.fo.flow.TableBody.layout(TableBody.java:172)
at org.apache.fop.fo.flow.Table.layout(Table.java:226)
at org.apache.fop.fo.flow.Block.layout(Block.java:259)
at org.apache.fop.fo.flow.StaticContent.layout(StaticContent.java:78)
at
org.apache.fop.fo.pagination.PageSequence.layoutStaticContent(PageSequence.j
ava:413)
at
org.apache.fop.fo.pagination.PageSequence.formatStaticContent(PageSequence.j
ava:362)
at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:302)
at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:191)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:178)
at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1398)
at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator
.java:1007)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1255)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:380)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:908)
at org.apache.fop.apps.Driver.render(Driver.java:459)
at org.apache.fop.apps.Driver.run(Driver.java:542)
at
formdirekt.pdfgen.POSTReceiveServlet.renderFO(POSTReceiveServlet.java:145)
at formdirekt.pdfgen.POSTReceiveServlet.doPost(POSTReceiveServlet.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
...
...
...


Gmane