I had to comment the usage of the Log*Transformers in the sample sitemap because they break the integration tests (run it.sh or it.bat from C3's root directory). The problem is that the logfile is written to the file system which doesn't work in a multi-module build (<map:parameter name="logfile" value="target/logasxml.log" /> -> there is no target directory at the base directory).

IMO the best idea would be changing the transformer configurations to use System.out but the current implementations close the output stream in their finish methods. That's of course useful for FileOutputStreams but mustn't happen for System.out.

IMO the best solution would be wrapping the usage of System.out with Commons IO's CloseShieldOutputStream (http://s.apache.org/commons-io-close-shield-outputstream). However, this would introduce a dependency of cocoon-sax on commons-io which should be avoided for a minor use case like this.

I see two possible solutions:

a) move the Log*Transformers to cocoon-optional and wrap the usage
   of System.out with the CloseShieldOutputStream

b) implement the CloseShield functionality ourselves and leave them
   where they are.

I would prefer option a) because it's the simpler solution and leads to less code.

WDYT?

--
Reinhard Pötz         Founder & Managing Director, Indoqa and Deepsearch
                        http://www.indoqa.com/people/reinhard-poetz.html

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member                  reinh...@apache.org
________________________________________________________________________

      Furthermore, I think Oracle has to honor the JSPA agreement.
    http://s.apache.org/JCPIsDead       http://s.apache.org/tck-trap

Reply via email to