We're updating the issue view to help you get more done. 

NullPointerException calculating product reminder due date

Description

From a 1.8 error report:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 java.lang.NullPointerException: Name is null at java.lang.Enum.valueOf(Unknown Source) at org.openvpms.archetype.rules.util.DateUnits.valueOf(DateUnits.java:25) at org.openvpms.archetype.rules.patient.reminder.ReminderRules.calculateProductReminderDueDate(ReminderRules.java:222) at org.openvpms.web.workspace.customer.charge.CustomerChargeActItemEditor.updateReminders(CustomerChargeActItemEditor.java:1049) at org.openvpms.web.workspace.customer.charge.CustomerChargeActItemEditor.productModified(CustomerChargeActItemEditor.java:798) at org.openvpms.web.component.im.edit.act.ActItemEditor.productModified(ActItemEditor.java:419) at org.openvpms.web.component.im.edit.act.ActItemEditor$1.modified(ActItemEditor.java:598) at org.openvpms.web.component.property.ModifiableListeners.notifyListeners(ModifiableListeners.java:92) at org.openvpms.web.component.edit.Editors.onModified(Editors.java:369) at org.openvpms.web.component.edit.Editors$1.modified(Editors.java:95) at org.openvpms.web.component.property.ModifiableListeners.notifyListeners(ModifiableListeners.java:92) at org.openvpms.web.component.property.AbstractProperty.refresh(AbstractProperty.java:283) at org.openvpms.web.component.property.IMObjectProperty.modified(IMObjectProperty.java:528) at org.openvpms.web.component.property.IMObjectProperty.setValue(IMObjectProperty.java:126) at org.openvpms.web.component.im.edit.AbstractIMObjectReferenceEditor.updateProperty(AbstractIMObjectReferenceEditor.java:227) at org.openvpms.web.component.im.edit.AbstractSelectorPropertyEditor.updateProperty(AbstractSelectorPropertyEditor.java:242) at org.openvpms.web.component.im.edit.AbstractSelectorPropertyEditor.setObject(AbstractSelectorPropertyEditor.java:159) at org.openvpms.web.component.im.product.ProductReferenceEditor.setProduct(ProductReferenceEditor.java:196) at org.openvpms.web.component.im.product.ProductReferenceEditor.onSelected(ProductReferenceEditor.java:94) at org.openvpms.web.component.im.product.ProductReferenceEditor.onSelected(ProductReferenceEditor.java:62) at org.openvpms.web.component.im.edit.AbstractSelectorPropertyEditor.onSelected(AbstractSelectorPropertyEditor.java:209) at org.openvpms.web.component.im.edit.AbstractSelectorPropertyEditor$2.selected(AbstractSelectorPropertyEditor.java:116) at org.openvpms.web.component.im.select.IMObjectSelector.onSelected(IMObjectSelector.java:337) at org.openvpms.web.component.im.select.IMObjectSelector$4.onClose(IMObjectSelector.java:313) at org.openvpms.web.echo.event.WindowPaneListener.windowPaneClosing(WindowPaneListener.java:37) at nextapp.echo2.app.WindowPane.fireWindowClosing(WindowPane.java:154) at org.openvpms.web.echo.dialog.PopupWindow.fireWindowClosing(PopupWindow.java:215) at nextapp.echo2.app.WindowPane.userClose(WindowPane.java:795) at org.openvpms.web.echo.dialog.PopupDialog.userClose(PopupDialog.java:267) at org.openvpms.web.echo.dialog.PopupWindow.close(PopupWindow.java:142) at org.openvpms.web.echo.dialog.PopupDialog.close(PopupDialog.java:422) at org.openvpms.web.component.im.query.BrowserDialog.close(BrowserDialog.java:257) at org.openvpms.web.echo.dialog.PopupDialog.onOK(PopupDialog.java:328) at org.openvpms.web.component.im.query.BrowserDialog.onOK(BrowserDialog.java:237) at org.openvpms.web.component.im.query.BrowserDialog.onSelected(BrowserDialog.java:278) at org.openvpms.web.component.im.query.BrowserDialog$2.selected(BrowserDialog.java:220) at org.openvpms.web.component.im.query.AbstractBrowser.notifySelected(AbstractBrowser.java:111) at org.openvpms.web.component.im.query.AbstractTableBrowser.onSelect(AbstractTableBrowser.java:355) at org.openvpms.web.component.im.query.AbstractTableBrowser.access$000(AbstractTableBrowser.java:47) at org.openvpms.web.component.im.query.AbstractTableBrowser$1.onAction(AbstractTableBrowser.java:246) at org.openvpms.web.echo.event.ActionListener.actionPerformed(ActionListener.java:40) at nextapp.echo2.app.Table.fireActionEvent(Table.java:332) at nextapp.echo2.app.Table.processInput(Table.java:586) at org.openvpms.web.echo.table.KeyTable.processInput(KeyTable.java:131) at nextapp.echo2.app.update.ClientUpdateManager.process(ClientUpdateManager.java:116) at nextapp.echo2.app.update.UpdateManager.processClientUpdates(UpdateManager.java:89) at nextapp.echo2.webcontainer.ContainerSynchronizeService.renderUpdate(ContainerSynchronizeService.java:471) at nextapp.echo2.webrender.service.SynchronizeService.service(SynchronizeService.java:279) at nextapp.echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:273) at org.openvpms.web.echo.servlet.SpringWebContainerServlet.process(SpringWebContainerServlet.java:178) at nextapp.echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:189) at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openvpms.web.echo.servlet.Log4JMDCUserFilter.doFilter(Log4JMDCUserFilter.java:58) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 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:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)

This is being caused by an unpopulated periodUom node on an entityRelationship.productReminder.

The code should handle this by treating a missing value as 'YEARS'.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Fix versions

Affects versions

1.8

Priority

Minor