Uploaded image for project: 'Publication Workflow Application'
  1. Publication Workflow Application
  2. XAWORKFLOW-32

Null pointer exception when trying to start workflow as target (from script)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.8
    • Labels:
      None
    • Similar issues:

      Description

      Since this commit https://github.com/xwiki-contrib/workflow-publication/commit/8f08ddc4ad8ff5ee43c195318e31c26b7114242f the workflow service API has a function allowing to start the workflow as target on a given document. This functionality is not exposed in the UI, as far as I remember, but can be called from a script.

      However, when trying to call that function from a script with workflow 1.7, the following exception occurs:

      class java.lang.NullPointerException: null
          at org.xwiki.workflowpublication.internal.DefaultPublicationWorkflow.getMessage(DefaultPublicationWorkflow.java:1293)
          at org.xwiki.workflowpublication.internal.DefaultPublicationWorkflow.startWorkflowAsTarget(DefaultPublicationWorkflow.java:565)
          at org.xwiki.workflowpublication.internal.PublicationWorkflowService.startWorkflowAsTarget(PublicationWorkflowService.java:145)
          at org.xwiki.workflowpublication.internal.PublicationWorkflowService$startWorkflowAsTarget.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
          at Script37.distributeDocument(Script37.groovy:206)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:151)
          at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$2.invokeMethod(GroovyScriptEngineImpl.java:327)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
          at Script37.run(Script37.groovy:315)
          at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:343)
          at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:152)
          at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.eval(AbstractJSR223ScriptMacro.java:340)
          at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:249)
          at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:194)
          at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.evaluateBlock(AbstractJSR223ScriptMacro.java:60)
          at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
          at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
          at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:272)
          at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
          at org.xwiki.rendering.internal.macro.DefaultMacroContentParser.parse(DefaultMacroContentParser.java:112)
          at org.xwiki.rendering.internal.macro.DefaultMacroContentParser.parse(DefaultMacroContentParser.java:82)
          at org.xwiki.contrib.jobmacro.internal.JobMacroJob.runInternal(JobMacroJob.java:111)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
          at org.xwiki.contrib.jobmacro.internal.JobMacroJob.run(JobMacroJob.java:92)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

            • Assignee:
              lucaa Anca Luca
              Reporter:
              lucaa Anca Luca
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: