Thanks,

Your idea was spot on. It was the JVM. We were running 1.6.0_10 which was causing the problem. When we rolled back to 1.6.0_7 it fixed it. We have had other issues with 1.6.0_10 as well, so this is not Saxon specific.

Cheers
Lloyd

On Mon, Nov 17, 2008 at 8:04 PM, Michael Kay <mike@saxonica.com> wrote:
It's going to be difficult to get to the bottom of this: I can only be of limited help with a problem that I can't reproduce. It feels to me as if it could well be a Java compiler or JVM bug.
 
The code is evaluating an XPath translate() call, and it believes that one of the arguments is a string that contains a Unicode surrogate pair. It comes to this belief because the length() of the string is not the same as the string-length(), which is the number of characters not counting those in the range 55296 - 56319. It then tries to expand the string into an array of integers (combining surrogate pairs into a single integer) and falls over, I suspect, because there's a malformed surrogate pair.
 
So there's some corruption in the content of the string or of its length. It's not necessarily even a java.lang.String, it could be any CharSequence including some Saxon classes that implement CharSequence.
 
First thing to do is establish whether your data really does contain any Unicode characters above 65535. I suspect it doesn't, and there's some corruption that has got the code onto this path.
 
If it's reproduceable and crashes in the same place, then I think it would be a good idea to find some way of getting a debugger onto it. Or try recompiling the Saxon code with some diagnostics built in.
 
Michael Kay
http://www.saxonica.com/


From: Lloyd Houseman [mailto:lloyd.houseman@gmail.com 
Sent: 17 November 2008 17:38
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Solaris problem?

Hi Anyone,

I'm having a problem with Saxon-B 9 running on Solaris. I'm am not using the command line version, but rather compiling the XSLT's into a cache bean in spring. The code works fine on all the developers machines running Windows. It also works fine on both the development box and beta which are running Linux. It just dosn't work on our release candidate which is running Solaris.

Here is the stack trace of the exception I get when I call the transform() method on my net.sf.saxon.s9api.XsltTransformer object.

java.lang.ArrayIndexOutOfBoundsException: 0
at net.sf.saxon.value.StringValue.expand(StringValue.java:391)
at net.sf.saxon.functions.Translate.buildMap(Translate.java:106)
at net.sf.saxon.functions.Translate.translate(Translate.java:71)
at net.sf.saxon.functions.Translate.evaluateItem(Translate.java:52)
at net.sf.saxon.instruct.SimpleContentConstructor.evaluateItem(SimpleContentConstructor.java:261)
at net.sf.saxon.instruct.ValueOf.evaluateItem(ValueOf.java:261)
at net.sf.saxon.instruct.SimpleNodeConstructor.iterate(SimpleNodeConstructor.java:219)
at net.sf.saxon.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:238)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
at net.sf.saxon.instruct.GeneralVariable.getSelectValue(GeneralVariable.java:373)
at net.sf.saxon.instruct.Instruction.assembleParams(Instruction.java:147)
at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:291)
at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:281)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:281)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:549)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:281)
at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:321)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
at net.sf.saxon.Controller.transform(Controller.java:1621)
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at coldfusion.runtime.StructBean.invoke(StructBean.java:511)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2300)
at cfindex2ecfm1619093488.runPage(/opt/sites/www.192.com/rc/tests/xml/index.cfm:72)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at com.intergral.fusionreactor.filter.FusionReactorFilter.G(Unknown Source)
at com.intergral.fusionreactor.filter.FusionReactorFilter.B(Unknown Source)
at com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(Unknown Source)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Thanks in advance for any help anyone could give. If there is anything more you need, let me know and I'll see what I am allowed to supply.







-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/saxon-help