File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes WebSphere XML parsing problem ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WebSphere XML parsing problem ??" Watch "WebSphere XML parsing problem ??" New topic

WebSphere XML parsing problem ??

JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Hi all,
Here is the big picture.
Inside an enterprise application (thus using WAS 5.0.2 libraries), I have a XML to validate according to a XSD schema.
To do it, I use a special Xerces feature (even if actually, as I use Websphere, this is XML4J) :

parser.setFeature("", true);
parser.setFeature("", true);

Everythink works just fine...... but.
When I try multithreading (to simulate a bunch of users), then the validation is SOMETIME broken.
For some threads, the validation returns :
cvc-attribute.3: The value '2003-11-14' of attribute 'xx' on element 'xx'
is not valid with respect to its type.

Sounds like it is always on an attribute which type is Date
I'm sure the XML is correct, because the multithreaded process send the same XML, and only some of them does not pass the validation, while others do.

Any clue, idea, advise ??

/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Howard Kushner
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
Hello Jean-Louis,
I am afraid that the parser is not thread-safe, and I quote: "An instance of the parser can be accessed from multiple threads, provided the application guarantees that only one thread has entered a method of the parser at any one time."
Anybody else got a handle on this one?

Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
You arer right Howard :
From :
Is Xerces DOM implementation thread-safe?
No. DOM does not require implementations to be thread safe. If you need to access the DOM from multiple threads, you are required to add the appropriate locks to your application code.
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Nevertheless, my application is supposed to be thread-safe.
So even if Xerces is not, I should not face this kind of problem.
Moreover, a couple of tests has beed done.
Sounds like the probleme occur with XML4J 4.0.10 and XML4J 4.0.12, wich are bundled with webSphere 5.x.
But with :
XML4j v4.1.4
XML4j v4.2.2
Xerces v2.4.2
there is no validation exception due to multithreading....

Unfortunatelly, I can't change the XML parser bundled with WebSphere. I won't be supported by IBM anymore, and fear it crashes the whole server.
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Anyone ever encountered this problem.
Any help is appreciated
I agree. Here's the link:
subject: WebSphere XML parsing problem ??
It's not a secret anymore!