There's a reasonable chance this is our problem.  We've patched the code to use a Serializer configured to output XML instead of HTML and our discrepancies between threads went away.  XALANJ-1861 was a threading issue related to HTML output which was more likely to be exposed on a multi-processor host; we're running on a multi-processor platform.


Brian Minchau wrote:

Hi, Ed:
This also reminds me of XALANJ-1861.

http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=XALANJ-1861

This fix would be in the current CVS but not in 2.6.0




Hi, Ed.

"Edward L. Knoll" <[EMAIL PROTECTED]> wrote on 2004-12-06 01:19:14
PM:
  
We have a class that puts together a SAX processing chain.  We have put
together a threaded test driver to exercise instances of this class
concurrently and we're seeing some anomalous behavior involving
whitespace.  We're seeing extra line breaks and non breaking spaces
introduced into the final output stream.

Each instance of this class has it's own instances of the core
processing components:

- Serializer (up to three instances per transformation thread)
- XMLReader (never more than one per thread)
- TransformerHandlers (up to two per transformation thread)
- custom classes implementing the ContentHandler interface

The only (static) class instances (knowingly) shared across these
threads are:

- Templates for different transformations we may perform.
- Property generated from OutputPropertiesFactory configured for XML
    
output.
  
- Property generated from OutputPropertiesFactory configured for HTML
output..
    

     From your description, it sounds like you're putting together the
pieces in a way that ought to be thread-safe.

     I took a quick look at the classes that implement serialization, and I
notice that the Serializer.setOutputFormat(Properties) maintains a
reference to the argument Properties object that is passed in, as opposed
to making a copy of it.  Is it possible that your code makes changes to the
Properties object that's produced by OutputPropertiesFactory before passing
it to Serializer.setOutputFormat at the same time that some other
Serializer is using that same Properties object?

     I'm not saying that it's right or wrong for
Serializer.setOutputFormat(Properties) to use a reference to the Properties
object - just making an observation.
  
-- 
Edward L. Knoll   Phone (FedEx)     : (719)484-2717
                  e-mail (FedEx)    : [EMAIL PROTECTED]
                  e-mail (personal) : [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to