1) We have created viewWorkflowStatus.xhtml which will basically show the current status report.
2) We stored the process instance id into the database.
3) We have used org.camunda.bpm.engine.cdi.BusinessProcess object to start the camunda workflow and stored the process instance id into the mysql database.
3) We have a controller class called ProcessDiagramController.java. Which basically takes a current process instance id and return the org.camunda.bpm.engine.runtime.ProcessInstance object.
5) This process instance object is fetched by using the runtimeService.createProcessInstanceQuery().processDefinitionId(). By using this procedure we are getting the process instance object.
3) Then we will show the camunda workflow report.
It is working fine if JBOSS is running continuously but once we restarted the JBOSS server the org.camunda.bpm.engine.runtime.ProcessInstance object is getting null and workflow report is not runniing and it's throwing the NullPointerException.
Here is the exception report
JBWEB000065: HTTP Status 500 - Process definition id is null
Here is the stack trace:
JBWEB000309: type JBWEB000066: Exception report
JBWEB000068: message Process definition id is null
JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
JBWEB000070: exception
javax.servlet.ServletException: Process definition id is null
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
com.portal.ticket.filter.MultipartFilter.doFilter(MultipartFilter.java:127)
JBWEB000071: root cause
org.camunda.bpm.engine.ProcessEngineException: Process definition id is null
org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl.processDefinitionId(ProcessInstanceQueryImpl.java:104)
org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl.processDefinitionId(ProcessInstanceQueryImpl.java:35)
com.portal.ticket.controller.ProcessDiagramController.getCurrentProcessInstance(ProcessDiagramController.java:66)
com.portal.ticket.controller.ProcessDiagramController.getActiveActivityBoundsOfLatestProcessInstance(ProcessDiagramController.java:192)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:735)
javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
javax.el.CompositeELResolver.invoke(CompositeELResolver.java:246)
org.apache.el.parser.AstValue.getValue(AstValue.java:156)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
com.sun.faces.facelets.component.UIRepeat.getValue(UIRepeat.java:274)
com.sun.faces.facelets.component.UIRepeat.getDataModel(UIRepeat.java:250)
com.sun.faces.facelets.component.UIRepeat.setIndex(UIRepeat.java:444)
com.sun.faces.facelets.component.UIRepeat.doVisitChildren(UIRepeat.java:679)
com.sun.faces.facelets.component.UIRepeat.visitTree(UIRepeat.java:637)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIForm.visitTree(UIForm.java:371)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.saveView(FaceletPartialStateManagementStrategy.java:472)
com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89)
com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
com.portal.ticket.filter.MultipartFilter.doFilter(MultipartFilter.java:127)
JBWEB000072: note JBWEB000073: The full stack trace of the root cause is available in the JBoss Web/7.2.0.Final logs.
I am using mysql database, and it is configured correctly.