0
votes

I am trying to combine a set of XML files using XSLT in one of my servers and receiving the following error for set of files(not for all files):

 \f0\fs22 \cf2 \cb3 \CocoaLigature0 Writing to file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/cust_Story_u4f9.xml\
URIResolver.resolve href="Story_u4f9.xml" base="file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt"\
Building tree for file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/Story_u4f9.xml using class net.sf.saxon.tree.tiny.TinyBuilder\
Tree built in 6.666093ms\
Tree size: 287 nodes, 2003 characters, 388 attributes\
Writing to file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/cust_Story_u4ac.xml\
URIResolver.resolve href="Story_u4ac.xml" base="file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt"\
Building tree for file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/Story_u4ac.xml using class net.sf.saxon.tree.tiny.TinyBuilder\
java.lang.RuntimeException: Internal error evaluating template rule  at line 8 in module file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt\
    at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:366)\
    at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:456)\
    at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65)\
    at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433)\
    at net.sf.saxon.Controller.transformDocument(Controller.java:2277)\
    at net.sf.saxon.Controller.transform(Controller.java:1854)\
    at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:579)\
    at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:185)\
    at com.library.hook.action.RunnableDemo.simpleTransformI2W(RunnableDemo.java:768)\
    at com.library.hook.action.IdmlToXHTMLThread.run(IdmlToXHTMLThread.java:369)\
    at java.lang.Thread.run(Thread.java:748)\
Caused by: java.lang.NullPointerException\
    at oracle.xml.parser.v2.NonValidatingParser.resolveNS(NonValidatingParser.java:1803)\
    at oracle.xml.parser.v2.NonValidatingParser.expandNamespace(NonValidatingParser.java:1754)\
    at oracle.xml.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1445)\
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1274)\
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:324)\
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:291)\
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:207)\
    at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:451)\
    at net.sf.saxon.event.Sender.send(Sender.java:153)\
    at net.sf.saxon.functions.DocumentFn.makeDoc(DocumentFn.java:370)\
    at net.sf.saxon.functions.DocumentFn$DocumentMappingFunction.mapItem(DocumentFn.java:190)\
    at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:113)\
    at net.sf.saxon.expr.sort.DocumentOrderIterator.<init>(DocumentOrderIterator.java:47)\
    at net.sf.saxon.functions.DocumentFn.call(DocumentFn.java:161)\
    at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:546)\
    at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:278)\
    at net.sf.saxon.expr.instruct.ApplyTemplates.process(ApplyTemplates.java:251)\
    at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:470)\
    at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2131)\
    at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)\
    at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:368)\
    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:653)\
    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
    at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:453)\
    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:364)\
    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:311)\
    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:364)\
    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:311)\
    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
    at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:470)\
    at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2131)\
    at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)\
    at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:368)\
    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:653)\
    at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:711)\
    at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:353)\
    ... 10 more\

I have tried both document() and collection() methods of xslt which can be used to combine files. But getting the same error.

The major problem is, this error occurs only on this specific server. when I run the same set of files in my local or other servers, it is running without any problem.

The following are used in the process:

XSLT 2.0

saxon 9.7.0-8

java 1.7.0_95

Any help would be greatly appreciated.

1

1 Answers

0
votes

It has crashed deep within the Oracle XDK parser (Saxon is simply passing on the bad news). Unfortunately that parser isn't open source, and I doubt Oracle are monitoring this forum, so technically you should raise a support request with Oracle. In practice your best way forward is probably to switch to a different parser: either the parser built in to the JDK, or Apache Xerces.

I suspect the only reason you're using the XDK parser is that it happens to be around on the classpath, or present in the "endorsed libs" directory.

You can change the parser used by Saxon when you call the document() function using the method Processor.setConfigurationProperty(FeatureKeys.SOURCE_PARSER_CLASS, className).