RuntimeException using Saxon-HE 9.6.0.5
Added by Daniel Lemke over 9 years ago
Hi there,
I thought that might be the right place to report an issue that I recently had when trying to upgrade the Saxon library in my project from version 9.1.0.8 to the latest version 9.6.0.5.
Not sure if it's relevant but I'm using Saxon-HE in a .NET library, framework version is 4.5.
After upgrading to version 9.6.0.5, I encounter the following error on a quite large XSLT operation that is transforming an XML to another XML:
java.lang.RuntimeException was unhandled by user code HResult=-2146233088 Message=Internal error evaluating template at line 1 in module Source=saxon9he StackTrace: at net.sf.saxon.expr.instruct.Template.applyLeavingTail(XPathContextMajor context) at net.sf.saxon.trans.Mode.applyTemplates(ParameterSet parameters, ParameterSet tunnelParameters, XPathContextMajor context, Int32 locationId) at net.sf.saxon.Controller.transformDocument(NodeInfo startNode, Receiver outputDestination) at net.sf.saxon.Controller.transform(Source source, Receiver receiver) at Saxon.Api.XsltTransformer.Run(XmlDestination destination) at Kneip.XslTransformation.Saxon.SaxonXslTransformer.Transform(XsltTransformer xsltTransformer) in c:\projects\svn-be\Kneip.TransformationService - Copy\trunk\Kneip.XslTransformation.Saxon\SaxonXslTransformer.cs:line 154 at Kneip.XslTransformation.Saxon.SaxonXslTransformer.Transform(XmlDocument xmlDocument, XmlDocument xsltDocument) in c:\projects\svn-be\Kneip.TransformationService - Copy\trunk\Kneip.XslTransformation.Saxon\SaxonXslTransformer.cs:line 131 at Kneip.XslTransformation.Tests.SaxonXslTransformerTests.SaxonIssue() in c:\projects\svn-be\Kneip.TransformationService - Copy\trunk\Tests\KNEIP.XslTransformation.Tests\SaxonXslTransformerTests.cs:line 35 InnerException: java.lang.ArrayIndexOutOfBoundsException HResult=-2146233088 Message="" InnerException:
I simplified the XML and XSLT as much as possible, it should be possible to reproduce the issue using the following contents:
test
Any ideas what could be causing this?
Regards
Daniel
Replies (8)
Please register to reply
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by Michael Kay over 9 years ago
Thanks for reporting it, and for reducing it to a small repro.
It appears to run OK on the Java platform, so the next thing we''ll try is to see if we can reproduce it on .NET.
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by O'Neil Delpratt over 9 years ago
Hi,
I am not able to reproduce the problem on .NET either. I have tried running your supplied stylesheet and xml document from the command-line and in a simple C# code application using the s9api interface.
It would be good to know how you are running your program to get this error. It looks like you are running it from a s9api interface. Can you supply us your C# code as well please? A simple repo will do. You can send it on the post or privately if it has confidential content.
Thanks, O'Neil
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by Daniel Lemke over 9 years ago
Hi Michael and O'Neil,
Thanks for the quick response, awesome support! If you cannot reproduce it with your application, it might be related to the way that I'm calling the API.
Please find a sample console application attached to reproduce the problem.
SaxonSample.zip (8.3 KB) SaxonSample.zip |
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by O'Neil Delpratt over 9 years ago
Thanks for the repo. I have now managed to reproduce the same exception you reported. we will investigate it further the cause and get back to you.
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by O'Neil Delpratt over 9 years ago
A fix has been committed to subversion which will be available in the next maintenance release. See bug issue: https://saxonica.plan.io/issues/2360
As a workaround you could avoid using the .NET DOM for now if you can. You can just load the stylesheet and source as a .NET FileStream.
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by Michael Kay over 9 years ago
Note also that allowing Saxon to build its own internal tree representation of a document will be much more efficient than working with an externally-built DOM tree (typically 5-10 times faster).
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by O'Neil Delpratt over 9 years ago
I have added an nunit test case to test for regression of this fix in future releases.
RE: RuntimeException using Saxon-HE 9.6.0.5 - Added by Daniel Lemke over 9 years ago
Thank you very much for all the feedback guys, incredible good support! I'm using now a stream for the input and everything works fine, guess I'll leave it like that as you mentioned that it's faster anyway.
Please register to reply