cancel
Showing results for 
Search instead for 
Did you mean: 

Can't run activiti WF Alfresco 4.2.c, NullPointerException

koopa
Confirmed Champ
Confirmed Champ
After a succesful deploy of my custom Workflow, when I start it from Share it says it cannot start.
Share log says:
<blockcode>
09:53:12,615 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 01200000 Wrapped Exception (with status template): null
org.springframework.extensions.webscripts.WebScriptException: 01200000 Wrapped Exception (with status template): null
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:70)
   at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:240)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.springframework.extensions.webscripts.servlet.mvc.WebScriptView.renderMergedOutputModel(WebScriptView.java:104)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
   at org.alfresco.web.scripts.forms.FormUIGet.processFieldConstraintControl(FormUIGet.java:1956)
   at org.alfresco.web.scripts.forms.FormUIGet.generateConstraintModel(FormUIGet.java:1816)
   at org.alfresco.web.scripts.forms.FormUIGet.processFieldConstraints(FormUIGet.java:1701)
   at org.alfresco.web.scripts.forms.FormUIGet.generateFieldModel(FormUIGet.java:1315)
   at org.alfresco.web.scripts.forms.FormUIGet.generateDefaultSetModelUsingServerFields(FormUIGet.java:1255)
   at org.alfresco.web.scripts.forms.FormUIGet.processServerFields(FormUIGet.java:1117)
   at org.alfresco.web.scripts.forms.FormUIGet.processFields(FormUIGet.java:1058)
   at org.alfresco.web.scripts.forms.FormUIGet.generateFormUIModel(FormUIGet.java:666)
   at org.alfresco.web.scripts.forms.FormUIGet.generateFormModel(FormUIGet.java:609)
   at org.alfresco.web.scripts.forms.FormUIGet.generateModel(FormUIGet.java:265)
   at org.alfresco.web.scripts.forms.FormUIGet.executeImpl(FormUIGet.java:220)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
   … 40 more
</blockcode>
Don't know where to go… Just one thing that may be particular in what I do, I don't use a custom model, my activiti process refers to built-in tasks already living in alfresco/classes/workflow/workflowModel.xml. To be explicit, this is my context file:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
  <bean id="epWorkflowBootstrap" parent="workflowDeployer">
      
    <property name="workflowDefinitions">
      <list>
   <props>
     <prop key="engineId">activiti</prop>
     <prop key="location">alfresco/workflow/epCheckAndApprove.bpmn.xml</prop>
     <prop key="mimetype">text/xml</prop>         
          <prop key="redeploy">true</prop>
   </props>
      </list>
    </property>
      
    <property name="models">
      <list>
        <value>alfresco/workflow/workflowModel.xml</value>
      </list>
    </property>
   
    <property name="labels">
      <list>
   <value>alfresco/workflow/workflow-messages</value>
      </list>
    </property>
  </bean>
</beans>

Where is the problem? In the process definition? In the context file?

Any help appreciated!
7 REPLIES 7

koopa
Confirmed Champ
Confirmed Champ
It seems like it'the same error presented in these threads, <a href="http://forums.alfresco.com/forum/developer-discussions/content-modeling/constraints-create-bug-01312..." >here</a> and <a href="http://forums.alfresco.com/forum/end-user-discussions/alfresco-share/redering-custom-model-broken-42...">here</a>. Ther is also an open <a href="https://issues.alfresco.com/jira/browse/ALF-17730?page=com.googlecode.jira-suite-utilities:transitio...">issue on JIRA</a>.
But I am a little surprised because in my case I'm not using custom model at all. Simply the workflowModel already living in alfresco/workflow.
Anyone? In the meantime I'll try to figure it out how to customize the form, maybe via share-custom-config file. Don't know if it's the right way.

mstein
Champ in-the-making
Champ in-the-making
You shouldn't need the model property if you're using the oob model, they are already there. Can you post your workflow.xml?

koopa
Confirmed Champ
Confirmed Champ
Thank you mstein for the answer, this is the process definition:
<blockcode>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="EPsendMail" name="Processo invio mail E-Project" isExecutable="true">
    <startEvent id="alfrescoStart" name="Alfresco start" activiti:formKey="wf:submitAdhocTask"></startEvent>
    <serviceTask id="sendMail" name="Alfresco Mail Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
      <extensionElements>
        <activiti:field name="script">
          <activiti:string>var mail = actions.create("mail");
mail.execute(bpm_package);</activiti:string>
        </activiti:field>
        <activiti:field name="mail.parameters.to">
          <activiti:string>me@secservizi.it</activiti:string>
        </activiti:field>
        <activiti:field name="mail.parameters.from">
          <activiti:string>koopa@localalfresco.it</activiti:string>
        </activiti:field>
        <activiti:field name="mail.parameters.subject">
          <activiti:string>Bim bum bam</activiti:string>
        </activiti:field>
        <activiti:field name="mail.parameters.html">
          <activiti:string>Try try try</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="sendMail" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="alfrescoStart" targetRef="sendMail"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_EPsendMail">
    <bpmndi:BPMNPlane bpmnElement="EPsendMail" id="BPMNPlane_EPsendMail">
      <bpmndi:BPMNShape bpmnElement="alfrescoStart" id="BPMNShape_alfrescoStart">
        <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="310.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sendMail" id="BPMNShape_sendMail">
        <omgdc:Bounds height="55.0" width="105.0" x="260.0" y="300.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="420.0" y="310.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="365.0" y="327.0"></omgdi:waypoint>
        <omgdi:waypoint x="420.0" y="327.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="215.0" y="327.0"></omgdi:waypoint>
        <omgdi:waypoint x="260.0" y="327.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
</blockcode>
as you can see it is absolutely straightforward. I simplified it the most just to see if I can use it. But I can't even trying to start a wf instance from the workflow console.

koopa
Confirmed Champ
Confirmed Champ
I tried to start from a clean space, so I started a new tomcat with fresh alfresco and share war on a fresh new db but the result is the same. Created process with eclipse activiti designer, created my custom context file to make the new process visible, linking it to alfresco/workflow/workflowModel.xml, started tomcat, launched wf via UI… fail.
But I did a step forward, I can now start it from the wf console and really see the detail wf form once started. This is my new baby-written process:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="semplice" name="Processo di prova" isExecutable="true">
    <startEvent id="start" name="Alfresco start" activiti:formKey="wf:submitAdhocTask"></startEvent>
    <userTask id="userTask" name="Alfresco User Task" activiti:candidateGroups="commerciali" activiti:formKey="wf:adhocTask"></userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="userTask" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="start" targetRef="userTask"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_semplice">
    <bpmndi:BPMNPlane bpmnElement="semplice" id="BPMNPlane_semplice">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35.0" width="35.0" x="140.0" y="290.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="userTask" id="BPMNShape_userTask">
        <omgdc:Bounds height="55.0" width="105.0" x="220.0" y="280.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="380.0" y="290.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="325.0" y="307.0"></omgdi:waypoint>
        <omgdi:waypoint x="380.0" y="307.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="175.0" y="307.0"></omgdi:waypoint>
        <omgdi:waypoint x="220.0" y="307.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

koopa
Confirmed Champ
Confirmed Champ
Copy-Pasted both processes on 4.2.b and they work.

bprado
Champ in-the-making
Champ in-the-making
I had exactly the same problem. Same solution as well, thank you.

nyorai
Champ in-the-making
Champ in-the-making
I had exactly the same problem, just starting out learning Alfresco and spent a whole weekend scratching my head. Turns out I wasn't doing anything wrong after all! 4.2b works fine.