[jdom-interest] JDOM/Xerces: Thread Safe

New, Cecil (GEAE) cecil.new at ae.ge.com
Fri Oct 31 10:02:34 PST 2003


Not sure about different builder instances... I'll check.

Using DOMBuilder.

Brad Huffman responded that neither jdom nor xerces is thread safe.
Non-thread safety would seem to be a limiting factor for J2EE work.

-----Original Message-----
From: Jason Hunter [mailto:jhunter at servlets.com]
Sent: Friday, October 31, 2003 12:46 PM
To: New, Cecil (GEAE)
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] JDOM/Xerces: Thread Safe


New, Cecil (GEAE) wrote:

> We have a number of apps that use some common JDOM/Xerces code.  We have
> seen periodic failures and our testing points to some sort of
> multithreading/concurrency issues.
> 
> Setup:
> Weblogic 5.1 on Sun OS
> JDK 1.3.0_03
> Xerces 1.2.1
> JDOM beta8
> Using DOM Parser
> 
> Some findings might help:
> (note:parser instance is different in each thread)

And a different builder instance as well?  Are you using SAXBuilder or 
DOMBuilder?

-jh-

> (1) set validation to false ... seems to work fine with threads.  However,
> we don't consider this a viable solution or workaround :-)
> 
> (2) if each thread parses the same xml ... all threads fail invariably ..
> gives a "duplicate element " kind of exception
> If i print the Document from memory, sometimes it prints all the files
> properly, sometimes more than 1 fail. 
> 
> (3) if each thread parses a differnt xml
> Seems to pass ... if the xml is small ... fails erratically sometimes with
> NullPointerException.
> 
> Thanks for your help!
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
> 



More information about the jdom-interest mailing list