Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27239

Fix default rendition's context data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: 11.x
    • Component/s: Renditions

      Description

      Nuxeo documentation Renditions states that a variable named reason is available in the default rendition's context. Trying to access it generates the following stack trace in the server.log file:

      [org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl] Failed to evaluate script: 
      javax.script.ScriptException: ReferenceError: "reason" is not defined in <eval> at line number 2
      	at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:392) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:190) ~[nashorn.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getDefaultRendition(RenditionServiceImpl.java:569) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getDefaultRendition(RenditionServiceImpl.java:537) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.platform.rendition.adapter.DownloadBlobHolder.getBlob(DownloadBlobHolder.java:58) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.core.io.download.DownloadServiceImpl.resolveBlob(DownloadServiceImpl.java:632) ~[nuxeo-core-io-10.10-HF01.jar:?]
      	at org.nuxeo.ecm.automation.core.operations.blob.BulkDownload.lambda$run$0(BulkDownload.java:66) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_181]
      	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_181]
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_181]
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_181]
      	at org.nuxeo.ecm.automation.core.operations.blob.BulkDownload.run(BulkDownload.java:76) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:174) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:179) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$OperationMethod.invoke(OperationChainCompiler.java:151) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.lambda$invoke$0(OperationChainCompiler.java:218) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:326) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:291) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.invoke(OperationChainCompiler.java:215) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:115) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.lambda$run$0(OperationServiceImpl.java:105) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:326) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:291) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:105) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.adapters.AsyncOperationAdapter.lambda$null$0(AsyncOperationAdapter.java:177) ~[nuxeo-automation-server-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.adapters.AsyncOperationAdapter.lambda$doPost$1(AsyncOperationAdapter.java:174) ~[nuxeo-automation-server-10.10.jar:?]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
      Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "reason" is not defined
      	at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1442) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.scripts.Script$Recompilation$107$15$\^eval\_.run(<eval>:2) ~[?:?]
      	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:386) ~[nashorn.jar:?]
      	... 36 more
      2019-04-15T19:00:15,739 ERROR [Nuxeo-AsyncOperation-7e4d5da9-7124-4aea-a9a6-ee61f947b906] [org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl] Failed to evaluate script: 
      javax.script.ScriptException: ReferenceError: "reason" is not defined in <eval> at line number 2
      	at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:392) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:190) ~[nashorn.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getDefaultRendition(RenditionServiceImpl.java:569) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl.getDefaultRendition(RenditionServiceImpl.java:537) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.platform.rendition.adapter.DownloadBlobHolder.getBlob(DownloadBlobHolder.java:58) ~[nuxeo-platform-rendition-core-10.10.jar:?]
      	at org.nuxeo.ecm.core.io.download.DownloadServiceImpl.resolveBlob(DownloadServiceImpl.java:632) ~[nuxeo-core-io-10.10-HF01.jar:?]
      	at org.nuxeo.ecm.automation.core.operations.blob.BulkDownload.lambda$run$0(BulkDownload.java:66) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_181]
      	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_181]
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_181]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_181]
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_181]
      	at org.nuxeo.ecm.automation.core.operations.blob.BulkDownload.run(BulkDownload.java:76) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:174) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:179) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$OperationMethod.invoke(OperationChainCompiler.java:151) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.lambda$invoke$0(OperationChainCompiler.java:218) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:326) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:291) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.invoke(OperationChainCompiler.java:215) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:115) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.lambda$run$0(OperationServiceImpl.java:105) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:326) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:291) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:105) ~[nuxeo-automation-core-10.10-HF04.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.adapters.AsyncOperationAdapter.lambda$null$0(AsyncOperationAdapter.java:177) ~[nuxeo-automation-server-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$3(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:569) ~[nuxeo-runtime-jtajca-10.10.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.adapters.AsyncOperationAdapter.lambda$doPost$1(AsyncOperationAdapter.java:174) ~[nuxeo-automation-server-10.10.jar:?]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
      Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "reason" is not defined
      	at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1442) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.scripts.Script$Recompilation$113$15$\^eval\_.run(<eval>:2) ~[?:?]
      	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[nashorn.jar:?]
      	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199) ~[nashorn.jar:?]
      	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:386) ~[nashorn.jar:?]
      	... 36 more
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: