axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yevgeny Rouban" <yrou...@gmail.com>
Subject Re: [Axis2-1.0] Rampart/Axoim Threading Issues
Date Fri, 09 Feb 2007 13:21:49 GMT
Hello.

The threading fix committed to the Axiom DOM by Ruchith Fernando [1]
seems to not resolve the problem.

1. Imagine two threads enter the method setDOOMRequired(true).
The faster one calls System.setProperty(systemKey,
DocumentBuilderFactoryImpl.class.getName()).
Then the slower thread executes originalDocumentBuilderFactory =
DocumentBuilderFactory.newInstance(). This time the
originalDocumentBuilderFactory gets lost, because it becomes
org.apache.axiom.om.impl.dom.jaxp.DocumentBuilderFactoryImpl.

2. Another way to break the application for two threads is to call
setDOOMRequired(false) by one thread while the other is in
DOOMRequired state and is going to get a DocumentBuilderFactory. The
later thread will get original Document Builder (probably Xerces)
rather than DOOM because the system wide property is reset by the
first thread.

I do not know a good fix for the problem other than thread synchronization.
Another way (a bit clumsy) I see is to remove system property and set
up a thread context class loader which overrides Jar Service Provider
Mechanism via getResourceAsStream for
META-INF/services/javax.xml.parsers.DocumentBuilderFactory. This class
loader should return
org.apache.axiom.om.impl.dom.jaxp.DocumentBuilderFactoryImpl in
DOOMRequired state and delegate to the parent class loader in
non-DOOMRequired state.

[1] http://marc.theaimsgroup.com/?l=axis-user&m=116237867100030&w=2

-- 
Yevgeny Rouban
INTEL Middleware Products Division

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message