Created attachment 26110 [details] Proposed patch. I would like to suggest an extension to the xmlsec java API, namely to add a static method like unregisterDocument to org.apache.xml.security.utils.IdResolver to remove adocument from the static "docMap" WeakHashMap. Under long running high load test after some time we are experiencing a hangup with all the worker threads in the following state: "HTTP Handler 10.20.32.55" Id=185 in RUNNABLE at java.util.WeakHashMap.get(WeakHashMap.java:355) at org.apache.xml.security.utils.IdResolver.registerElementById(Unknown Source) at org.apache.xml.security.signature.XMLSignature.setId(Unknown Source) at org.apache.ws.security.message.WSSecSignature.prepare(WSSecSignature.java:360) at org.apache.rampart.builder.BindingBuilder.getSignatureBuider(BindingBuilder.java:387) at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:716) at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:433) at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95) at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147) at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:79) at org.apache.axis2.engine.Phase.invoke(Phase.java:325) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:429) With manual cleanup of the weak has map this situation is avoided.
Sorry for the delay :(
Patch applied thanks (minus the annotations - the project is compatible with JDK 1.4): Author: coheigea Date: Sat Oct 2 13:17:40 2010 New Revision: 1003793 URL: http://svn.apache.org/viewvc?rev=1003793&view=rev Log: [Bug 50036] IdResolver Java API extension. - Patch applied. Also merged a fix to get a test working with JDK 1.4. Modified: santuario/trunk/CHANGELOG.txt santuario/trunk/src/org/apache/xml/security/utils/IdResolver.java santuario/trunk/src_unitTests/org/apache/xml/security/test/keys/keyresolver/KeyResolverTest.java Colm.