elias
elias

Reputation: 15510

XSLT error - NamePool limit exceeded

I've built a proxy in WSO2 ESB 4.6.0 that process a lot of messages, but now it's throwing this exception.
Why it happens and how can I fix this?

ERROR {org.apache.synapse.mediators.transform.XSLTMediator} -  Unable to perform XSLT transformation using : Value {name ='null', keyValue ='conf:ManageWorkforce/xslt/SoapFaultToStandardHeader.xsl'} against source XPath : s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1] {org.apache.synapse.mediators.transform.XSLTMediator}
net.sf.saxon.om.NamePool$NamePoolLimitException: NamePool limit exceeded: max 1023 prefixes per URI
    at net.sf.saxon.om.NamePool.allocate(NamePool.java:437)
    at net.sf.saxon.om.FingerprintedQName.allocateNameCode(FingerprintedQName.java:99)
    at net.sf.saxon.tree.tiny.TinyBuilder.startElement(TinyBuilder.java:235)
    at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:285)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:405)
    at net.sf.saxon.event.Sender.send(Sender.java:178)
    at net.sf.saxon.Controller.transform(Controller.java:1790)
    at org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:289)
    at org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:191)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:112)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:230)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

EDIT

I've noticed that for the DSS operations with "Return Request Status" checkbox marked, the return is something like:

<axis2ns5:REQUEST_STATUS xmlns:axis2ns5="http://ws.wso2.org/dataservice">SUCCESSFUL</axis2ns5:REQUEST_STATUS>

where the number 5 in the prefix is incremented for each request to service. I guess that when this number reachs 1024, this error happens.

I would like to figure out how to prevent this.

Upvotes: 3

Views: 1790

Answers (2)

Michael Kay
Michael Kay

Reputation: 163625

This was extensively discussed in 2011 in the thread Jean-Michel kindly refers to.

Since that time there have been further developments to reduce the dependency on the NamePool. One of the most significant is perhaps that when you use third-party tree models like JDOM2 or AXIOM, NamePool namecodes are no longer allocated. So if you switched your processing to use such a tree model, you could process the strange XML files generated by Axis2 (which use vast numbers of namespace prefixes) without blowing Saxon's limits.

Upvotes: 2

Jean-Michel
Jean-Michel

Reputation: 5946

You can find details of this problem there : http://sourceforge.net/p/saxon/mailman/message/27969616/

This his a global limit of different prefixes for the same namespace

A solution would be to normalize the prefixes, if you can

Upvotes: 1

Related Questions