cancel
Showing results for 
Search instead for 
Did you mean: 

NPE when generating diagram with NoneThrowingEvent

mrysavy
Champ in-the-making
Champ in-the-making
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
5 REPLIES 5

leggebroten
Champ in-the-making
Champ in-the-making
I'm seeing the similar issue. 
No changes to models. 
Only change is upgrading from 5.15.1 to 5.16.1.
Seems related to signals and messages as models without them appear to deploy OK.
Attaching a simple model that throws the error

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

the problem is with

<eventBasedGateway id="eventGate"></eventBasedGateway>

Event based gateway is not supported in the org.activiti.image.impl.DefaultProcessDiagramCanvas#drawEventBasedGateway.

You can fix it easily and create pull request.

Regards
Martin

leggebroten
Champ in-the-making
Champ in-the-making
cool.  Will do.
But this was working in 5.15.1.  Curious what changed.

martin_grofcik
Confirmed Champ
Confirmed Champ

trademak
Star Contributor
Star Contributor
Fixed the issue on the current Github master