AnsweredAssumed Answered

NPE when generating diagram with NoneThrowingEvent

Question asked by mrysavy on Aug 27, 2014
Latest reply on Sep 1, 2014 by trademak
Hi,

when programatically deploying new diagram with NoneThrowingEvent, following NPE is raised

WARN  [2014-08-27 16:35:39,646] Error while generating process diagram, image will not be stored in repository
java.lang.NullPointerException
   at org.activiti.image.impl.DefaultProcessDiagramCanvas.drawCatchingEvent(DefaultProcessDiagramCanvas.java:413)
   at org.activiti.image.impl.DefaultProcessDiagramCanvas.drawThrowingNoneEvent(DefaultProcessDiagramCanvas.java:449)
   at org.activiti.image.impl.DefaultProcessDiagramGenerator$3.draw(DefaultProcessDiagramGenerator.java:135)
   at org.activiti.image.impl.DefaultProcessDiagramGenerator.drawActivity(DefaultProcessDiagramGenerator.java:489)
   at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateProcessDiagram(DefaultProcessDiagramGenerator.java:470)
   at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:382)
   at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:404)
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:130)
   at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:50)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:103)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:37)
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:78)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156)
   at TestActiviti.deploy(TestActiviti.java:61)
   at TestActiviti.deploy(TestActiviti.java:51)
   at TestActiviti.main(TestActiviti.java:34)


I think that the problem is in the DefaultProcessDiagramCanvas.drawCatchingEvent(…) method. When this method is called from drawThrowingNoneEvent(…) method in the same class, the third argument ("image") is null but the line 413 call image.getWidth(). I'm using 5.16.1 version of Activiti.

Thanks for the response and/or fix.
Michal

Outcomes