Activiti Explorer : Null Pointer Exception for Users with a Picture

Description

Here are the steps I performed to get this error:

  • downloaded activiti-5.10

  • updated the activiti-5.10/setup/build/demo/h2.data.sql to add new users, but don't add a picture. For example:
    insert into ACT_ID_USER values ('devmanager', 1, 'DEV', 'the Manager', 'devmanager@localhost', 'devmanager', '');

  • started the demo ant task.

  • deploy your favorite BAR that has a process step that involves the new user / group via the Explorer update interface.

  • goto user's queue, then attempt to view the "part of the process" button, in an attempt to view the BPMN 2.0 diagram.

You will see the following exception in the Tomcat window:

SEVERE: Error while closing command context
java.lang.NullPointerException
at org.activiti.engine.impl.persistence.entity.UserEntity.getPicture(UserEntity.java:78)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:47)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.IdentityServiceImpl.getUserPicture(IdentityServiceImpl.java:102)
at org.activiti.explorer.ui.task.UserDetailsComponent.addUserPicture(UserDetailsComponent.java:85)
at org.activiti.explorer.ui.task.UserDetailsComponent.attach(UserDetailsComponent.java:78)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.AbstractOrderedLayout.addComponent(AbstractOrderedLayout.java:70)
at org.activiti.explorer.ui.task.TaskDetailPanel.initPeopleDetails(TaskDetailPanel.java:284)
at org.activiti.explorer.ui.task.TaskDetailPanel.init(TaskDetailPanel.java:115)
at org.activiti.explorer.ui.task.TaskDetailPanel.attach(TaskDetailPanel.java:99)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.GridLayout.addComponent(GridLayout.java:223)
at org.activiti.explorer.ui.AbstractPage.setDetailComponent(AbstractPage.java:137)
at org.activiti.explorer.ui.task.TaskPage.access$000(TaskPage.java:44)
at org.activiti.explorer.ui.task.TaskPage$1.valueChange(TaskPage.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)

at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:891)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:529)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:666)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:635)
at com.vaadin.ui.Table.setValue(Table.java:1852)
at com.vaadin.ui.AbstractSelect.select(AbstractSelect.java:1377)
at org.activiti.explorer.ui.AbstractTablePage.selectElement(AbstractTablePage.java:79)
at org.activiti.explorer.ui.task.TaskPage.initUi(TaskPage.java:72)
at org.activiti.explorer.ui.AbstractPage.attach(AbstractPage.java:43)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.CssLayout.addComponent(CssLayout.java:93)
at org.activiti.explorer.ui.mainlayout.MainLayout.setMainContent(MainLayout.java:58)
at org.activiti.explorer.ui.MainWindow.switchView(MainWindow.java:79)
at org.activiti.explorer.DefaultViewManager.switchView(DefaultViewManager.java:272)
at org.activiti.explorer.DefaultViewManager.showInboxPage(DefaultViewManager.java:166)
at org.activiti.explorer.ui.task.listener.ClaimTaskClickListener.buttonClick(ClaimTaskClickListener.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)

at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.Button.fireClick(Button.java:539)
at com.vaadin.ui.Button.changeVariables(Button.java:206)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1299)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1219)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:735)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Nov 8, 2012 1:28:02 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.NullPointerException
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)

at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.Button.fireClick(Button.java:539)
at com.vaadin.ui.Button.changeVariables(Button.java:206)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1299)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1219)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:735)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.NullPointerException
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)

at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:891)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:529)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:666)
at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:635)
at com.vaadin.ui.Table.setValue(Table.java:1852)
at com.vaadin.ui.AbstractSelect.select(AbstractSelect.java:1377)
at org.activiti.explorer.ui.AbstractTablePage.selectElement(AbstractTablePage.java:79)
at org.activiti.explorer.ui.task.TaskPage.initUi(TaskPage.java:72)
at org.activiti.explorer.ui.AbstractPage.attach(AbstractPage.java:43)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.CssLayout.addComponent(CssLayout.java:93)
at org.activiti.explorer.ui.mainlayout.MainLayout.setMainContent(MainLayout.java:58)
at org.activiti.explorer.ui.MainWindow.switchView(MainWindow.java:79)
at org.activiti.explorer.DefaultViewManager.switchView(DefaultViewManager.java:272)
at org.activiti.explorer.DefaultViewManager.showInboxPage(DefaultViewManager.java:166)
at org.activiti.explorer.ui.task.listener.ClaimTaskClickListener.buttonClick(ClaimTaskClickListener.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)

... 22 more
Caused by: java.lang.NullPointerException
at org.activiti.engine.impl.persistence.entity.UserEntity.getPicture(UserEntity.java:78)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:47)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.IdentityServiceImpl.getUserPicture(IdentityServiceImpl.java:102)
at org.activiti.explorer.ui.task.UserDetailsComponent.addUserPicture(UserDetailsComponent.java:85)
at org.activiti.explorer.ui.task.UserDetailsComponent.attach(UserDetailsComponent.java:78)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponentContainer.attach(AbstractComponentContainer.java:97)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.AbstractOrderedLayout.addComponent(AbstractOrderedLayout.java:70)
at org.activiti.explorer.ui.task.TaskDetailPanel.initPeopleDetails(TaskDetailPanel.java:284)
at org.activiti.explorer.ui.task.TaskDetailPanel.init(TaskDetailPanel.java:115)
at org.activiti.explorer.ui.task.TaskDetailPanel.attach(TaskDetailPanel.java:99)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)

at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
at com.vaadin.ui.GridLayout.addComponent(GridLayout.java:223)
at org.activiti.explorer.ui.AbstractPage.setDetailComponent(AbstractPage.java:137)
at org.activiti.explorer.ui.task.TaskPage.access$000(TaskPage.java:44)
at org.activiti.explorer.ui.task.TaskPage$1.valueChange(TaskPage.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)

... 46 more

The work around is to you use the IdentityService to add a picture. I'm not smart enough to know how to supply a picture via SQL

Environment

Windows XP, 32-Bit, Java 6, FireFox Browser

Assignee

Tijs Rademakers

Reporter

Joseph Butler

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure