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

NPE thrown when saving medication with no List Price

Description

From a 1.8.1 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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 org.openvpms.component.business.service.ruleengine.RuleEngineException: Failed to execute the business rules for URI archetypeService.save.product.medication.before. at org.openvpms.component.business.service.ruleengine.RuleEngine.executeRules(RuleEngine.java:75) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.executeRules(ArchetypeRuleService.java:232) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.access$300(ArchetypeRuleService.java:45) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService$5.doInTransaction(ArchetypeRuleService.java:199) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.execute(ArchetypeRuleService.java:196) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.save(ArchetypeRuleService.java:134) at org.openvpms.component.business.service.archetype.DelegatingArchetypeService.save(DelegatingArchetypeService.java:223) at org.openvpms.web.component.im.edit.SaveHelper.save(SaveHelper.java:196) at org.openvpms.web.component.im.edit.SaveHelper.save(SaveHelper.java:173) at org.openvpms.web.component.im.edit.SaveHelper.save(SaveHelper.java:141) at org.openvpms.web.component.im.edit.SaveHelper.save(SaveHelper.java:130) at org.openvpms.web.component.im.util.IMObjectDeleter.doDeactivate(IMObjectDeleter.java:181) at org.openvpms.web.component.im.util.DefaultIMObjectDeleter$1.onOK(DefaultIMObjectDeleter.java:75) at org.openvpms.web.echo.dialog.PopupDialogListener.onAction(PopupDialogListener.java:129) at org.openvpms.web.echo.dialog.PopupDialogListener.onClose(PopupDialogListener.java:40) 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.MessageDialog.userClose(MessageDialog.java:109) 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.echo.dialog.PopupDialog.onOK(PopupDialog.java:328) at org.openvpms.web.echo.dialog.PopupDialog.onButton(PopupDialog.java:299) at org.openvpms.web.echo.dialog.PopupDialog.onButtonProtected(PopupDialog.java:466) at org.openvpms.web.echo.dialog.PopupDialog.access$000(PopupDialog.java:34) at org.openvpms.web.echo.dialog.PopupDialog$3.onAction(PopupDialog.java:453) at org.openvpms.web.echo.event.ActionListener.actionPerformed(ActionListener.java:40) at nextapp.echo2.app.button.AbstractButton.fireActionPerformed(AbstractButton.java:135) at echopointng.ButtonEx$1.actionPerformed(ButtonEx.java:120) at nextapp.echo2.app.button.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70) at echopointng.model.DefaultButtonModelEx.doAction(DefaultButtonModelEx.java:51) at echopointng.ButtonEx.processInput(ButtonEx.java:202) 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:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) Caused by: org.springmodules.jsr94.Jsr94InvalidRuleSessionException: java.lang.NullPointerException; nested exception is RuleException(javax.rules.InvalidRuleSessionException: java.lang.NullPointerException), root cause(org.drools.spi.ConsequenceException: java.lang.NullPointerException) at org.springmodules.jsr94.core.Jsr94Template.executeStateless(Jsr94Template.java:149) at org.springmodules.jsr94.core.Jsr94RuleSupport.executeStateless(Jsr94RuleSupport.java:108) at org.springmodules.jsr94.core.Jsr94RuleSupport.executeStateless(Jsr94RuleSupport.java:148) at org.openvpms.component.business.service.ruleengine.RuleEngine.executeRules(RuleEngine.java:73) ... 75 more Caused by: javax.rules.InvalidRuleSessionException: java.lang.NullPointerException at org.drools.jsr94.rules.StatelessRuleSessionImpl.executeRules(StatelessRuleSessionImpl.java:169) at org.drools.jsr94.rules.StatelessRuleSessionImpl.executeRules(StatelessRuleSessionImpl.java:126) at org.springmodules.jsr94.core.Jsr94RuleSupport$1.execute(Jsr94RuleSupport.java:115) at org.springmodules.jsr94.core.Jsr94Template.executeStateless(Jsr94Template.java:146) ... 78 more Caused by: org.drools.spi.ConsequenceException: java.lang.NullPointerException at org.drools.semantics.java.JavaBlockConsequence.invoke(JavaBlockConsequence.java:150) at org.drools.reteoo.AgendaItem.fire(AgendaItem.java:168) at org.drools.reteoo.Agenda.fireNextItem(Agenda.java:476) at org.drools.reteoo.WorkingMemoryImpl.fireAllRules(WorkingMemoryImpl.java:253) at org.drools.reteoo.WorkingMemoryImpl.fireAllRules(WorkingMemoryImpl.java:268) at org.drools.jsr94.rules.StatelessRuleSessionImpl.executeRules(StatelessRuleSessionImpl.java:165) ... 81 more Caused by: java.lang.NullPointerException at org.openvpms.archetype.rules.product.ProductPriceUpdater.checkEquals(ProductPriceUpdater.java:245) at org.openvpms.archetype.rules.product.ProductPriceUpdater.needsUpdate(ProductPriceUpdater.java:225) at org.openvpms.archetype.rules.product.ProductPriceUpdater.update(ProductPriceUpdater.java:119) at org.openvpms.archetype.rules.product.ProductPriceUpdater.update(ProductPriceUpdater.java:105) at Consequence_0.invoke(ANONYMOUS.java:9) at org.drools.semantics.java.JavaBlockConsequence.invoke(JavaBlockConsequence.java:130) ... 86 more

This is caused by a entityRelationship.productSupplier having no list price.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Fix versions

Affects versions

1.8.1

Priority

Minor