Error when running transformation in Oxy 18.1, but not outside Oxygen

martindholmes
Posts: 104
Location: Victoria, BC, Canada

Error when running transformation in Oxy 18.1, but not outside Oxygen

Mon Dec 19, 2016 10:20 pm

Hi there,

We have a very weird situation with the latest release of the TEI plugin (which we've had to roll back as a result). Doing a transformation which builds an ODD file to RelaxNG, I get an error when we run the process inside Oxygen, but if I copy/paste the entire command line from the Oxygen output window into bash and run it there, I don't get the error. Below is what we're running, and the result from inside Oxygen; it's complaining about an internal Saxon error relating to variable binding, but we don't see that error when we run outside the Oxygen environment, which is very odd indeed. Can you shed any light on this?

Executing:
"/home/mholmes/Oxygen XML Editor 18/jre/bin/java" -Xmx256m -classpath "/home/mholmes/Oxygen XML Editor 18/tools/ant/lib/ant-launcher.jar" "-Dant.home=/home/mholmes/Oxygen XML Editor 18/tools/ant" org.apache.tools.ant.launch.Launcher -lib "/home/mholmes/Oxygen XML Editor 18/classes" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygen.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygenAuthor.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygenDeveloper.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygenEclipse.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygenAuthorEclipse.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/oxygenDeveloperEclipse.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/resolver.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/xercesImpl.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/saxon9ee.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/saxon.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/xml-apis-ext.jar" -lib "/home/mholmes/Oxygen XML Editor 18/lib/log4j.jar" -f "/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/relaxng/build-to.xml" "-DinputFile=/home/mholmes/Downloads/tei/syriaca-tei-main.odd" "-DoutputFile=/home/mholmes/Downloads/tei/out/syriaca-tei-main.rng" "-Dprofile=default" "-Dlang=en" "-Doxygenlib=/home/mholmes/Oxygen XML Editor 18/lib" "-DdefaultSource=file:/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/odd/p5subset.xml" "-Dwebhelp.trial.license=no"

Buildfile: /home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/relaxng/build-to.xml

go:
[echo] Do ODD expand processing (schema ${selectedSchema})
[xslt] Processing /home/mholmes/Downloads/tei/syriaca-tei-main.odd to /home/mholmes/Downloads/tei/syriaca-tei-main.odd.processedodd
[xslt] Loading stylesheet /home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/odds/odd2odd.xsl
[echo] XSLT generate relaxng files
[xslt] Processing /home/mholmes/Downloads/tei/syriaca-tei-main.odd.processedodd to /home/mholmes/Downloads/tei/out/syriaca-tei-main.rng
[xslt] Loading stylesheet /home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/profiles/default/relaxng/to.xsl
[xslt] *** Internal Saxon error: local variable encountered whose binding has been deleted
[xslt] Variable name: zz:zz187457031
[xslt] Line number of reference: 409 in file:/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/odds/odd2relax.xsl
[xslt] Line number of declaration: 409 in file:/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/odds/odd2relax.xsl
[xslt] DECLARATION:
[xslt] <let variable="Q{http://saxon.sf.net/}zz187457031"
[xslt] as="element()"
[xslt] slot="-999">
[xslt] <be>
[xslt] <treat as="element()">
[xslt] <variableReference name="current" slot="1"/>
[xslt] </treat>
[xslt] </be>
[xslt] <return>
[xslt] <let variable="Q{http://saxon.sf.net/}zz701119748"
[xslt] as="xs:untypedAtomic*"
[xslt] indexable="true"
[xslt] slot="4">
[xslt] <be>
[xslt] <data>
[xslt] <slash>
[xslt] <variableReference name="spec" slot="0"/>
[xslt] <axis name="attribute" nodeTest="attribute(Q{}ns)"/>
[xslt] </slash>
[xslt] </data>
[xslt] </be>
[xslt] <return>
[xslt] <convertUntyped to="xs:string">
[xslt] <data>
[xslt] <forEach>
[xslt] <functionCall name="in-scope-prefixes">
[xslt] <treat as="element()">
[xslt] <variableReference name="current" slot="1"/>
[xslt] </treat>
[xslt] </functionCall>
[xslt] <return>
[xslt] <choose>
[xslt] <when>
[xslt] <indexedLookup>
[xslt] <variableReference name="Q{http://saxon.sf.net/}zz701119748" slot="4"/>
[xslt] <functionCall name="namespace-uri-for-prefix">
[xslt] <dot/>
[xslt] <variableReference name="Q{http://saxon.sf.net/}zz187457031" slot="-999"/>
[xslt] </functionCall>
[xslt] </indexedLookup>
[xslt] </when>
[xslt] <then>
[xslt] <valueOf>
[xslt] <dot/>
[xslt] </valueOf>
[xslt] </then>
[xslt] </choose>
[xslt] </return>
[xslt] </forEach>
[xslt] </data>
[xslt] </convertUntyped>
[xslt] </return>
[xslt] </let>
[xslt] </return>
[xslt] </let>
[xslt] Failed to process /home/mholmes/Downloads/tei/syriaca-tei-main.odd.processedodd

BUILD FAILED
/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/relaxng/build-to.xml:30: The following error occurred while executing this line:
/home/mholmes/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/common/teianttasks.xml:349: java.lang.IllegalStateException: *** Internal Saxon error: local variable encountered whose binding has been deleted
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:597)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.expr.parser.ExpressionTool.allocateSlots(ExpressionTool.java:606)
at net.sf.saxon.style.StyleElement.allocateSlots(Unknown Source)
at net.sf.saxon.style.XSLTemplate.optimize(XSLTemplate.java:632)
at net.sf.saxon.style.StylesheetPackage.optimizeTopLevel(Unknown Source)
at net.sf.saxon.style.StylesheetPackage.compile(Unknown Source)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:201)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:94)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(Unknown Source)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:876)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:414)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 3 seconds

The process finished with exit code: 1
martindholmes
Posts: 104
Location: Victoria, BC, Canada

Re: Error when running transformation in Oxy 18.1, but not outside Oxygen

Mon Dec 19, 2016 11:53 pm

It might be related to this:

https://saxonica.plan.io/issues/3069

but I still can't see how it only happens when running from within Oxygen, not when running exactly the same command in bash directly. I've tried updating the Saxon in Oxygen to 9.7 using the add-on method, but it makes no difference; the fix for Saxon may not have made its way into the Oxygen add-on 9.7 yet, though.

We desperately need a clue as to how to work around this.
alex_jitianu
Posts: 600

Re: Error when running transformation in Oxy 18.1, but not outside Oxygen

Tue Dec 20, 2016 1:52 pm

Hi Martin,

The Saxon issue you've it's probably the cause.

but I still can't see how it only happens when running from within Oxygen, not when running exactly the same command in bash directly

Are you using exactly the same command, copied from the console inside Oxygen? I'm curious if the -lib parameters are the same, more specifically is oxygen.jar is there. Anyway, in the Saxon issue it says that the Java version is also important:
We have now established that this fails running in the IDE under JDK 1.6, though it succeeds under JDK 1.8.

so perhaps different JVMs are used from Oxygen and from the command line.
the fix for Saxon may not have made its way into the Oxygen add-on 9.7 yet, though.

The "ODD file to RelaxNG" transformation is an ANT transformation so the 9.7 add-on has no effect on it (the transformation's configuration passed the built-in Saxon jar). Besides that, the fix done by Michael Key wasn't released yet (the flag "Fixed in Maintenance Release" is not set).

Can you send me a sample ODD file on support@oxygenxml.com for me to reproduce the issue? I tried with a trivial ODD but I didn't managed to reproduce it.

Best regards,
Alex
alex_jitianu
Posts: 600

Re: Error when running transformation in Oxy 18.1, but not outside Oxygen

Tue Dec 20, 2016 3:58 pm

Hi Martin,

I managed to reproduce the issue with by using oxygen-tei-6.1.0 and I also see the different behavior between running the transformation in Oxygen and running it from the command line. I'll investigate some more. As a side note, I see that using Saxon 9.7 will make the transformation succeed.

Best regards,
Alex
alex_jitianu
Posts: 600

Re: Error when running transformation in Oxy 18.1, but not outside Oxygen

Tue Dec 20, 2016 4:28 pm

Hi Martin,

When running the transformation from within Oxygen, Saxon will be licensed and because of that it will apply a number of optimizations. This is why is failing. When running the same command line outside Oxygen, Saxon will not be license (the Home Edition will be used) and so the optimizations will not be activated.

As a solution, I suggest making the "ODD file to RelaxNG" run with Saxon HE. To do that you'll have to edit the scenario, click "Libraries" and remove the entry ${oxygenHome}/lib/oxygen.jar .
Alex

Return to “TEI”

Who is online

Users browsing this forum: No registered users and 0 guests