1

Getting NPE after click on Approve button for the payment activity.And also, getting NPE for Reject button. Even though user is authorized to approve the activity but unable to figure it out from which point it throws null value.

Here are the below logs-

ERROR Displaying to the user an exception message that is not a UserDisplayableException
java.lang.NullPointerException
    at com.guidewire.pl.system.entity.proxy.AbstractKeyableBeanProxy.getFieldValue(AbstractKeyableBeanProxy.java:159)
    at com.guidewire.pl.system.entity.proxy.BeanProxy.getFieldValue(BeanProxy.java:593)
    at com.guidewire.pl.system.graph.AbstractForeignKeyLink.getSourceIdsFromBundleIfPossible(AbstractForeignKeyLink.java:32)
    at com.guidewire.pl.system.graph.Chain.getSourceIdsFromBundleIfPossible(Chain.java:139)
    at com.guidewire.pl.system.graph.Chain.getSourceIdsFromBundleIfPossible(Chain.java:135)
    at com.guidewire.pl.system.graph.Chain.getSourceIdsViaBundleIfPossible(Chain.java:44)
    at com.guidewire.pl.system.integration.messaging.events.TopLevelEntityGraph.processChainInBundle(TopLevelEntityGraph.java:79)
    at com.guidewire.pl.system.integration.messaging.events.TopLevelEntityGraph.getTopLevelObjectIdsReferringToUpdatedBean(TopLevelEntityGraph.java:43)
    at com.guidewire.pl.system.bundle.validation.GraphToValidatableBeansImpl.getTopLevelObjectIdsReferringToUpdatedBean(GraphToValidatableBeansImpl.java:63)
    at com.guidewire.pl.system.bundle.validation.RootValidatableBeansFinderImpl.findRootBeansToValidate(RootValidatableBeansFinderImpl.java:145)
    at com.guidewire.pl.system.preupdate.PreUpdateHelper.executePreUpdateRules(PreUpdateHelper.java:21)
    at com.guidewire.pl.system.database.DatabaseBundleWriter.prepareBundleForWritePreIDGeneration(DatabaseBundleWriter.java:73)
    at com.guidewire.pl.system.bundle.BundleWriter.commitBundle(BundleWriter.java:85)
    at com.guidewire.pl.system.transaction.SessionImpl.flush(SessionImpl.java:139)
    at com.guidewire.pl.system.transaction.SessionImpl.commit(SessionImpl.java:200)
    at com.guidewire.pl.system.transaction.TransactionManagerImpl.execute(TransactionManagerImpl.java:115)
    at com.guidewire.pl.system.transaction.TransactionManagerImpl.commitBundle(TransactionManagerImpl.java:59)
    at com.guidewire.pl.system.bundle.EntityBundleImpl.commitAndGetBeans(EntityBundleImpl.java:1669)
    at com.guidewire.pl.system.bundle.EntityBundleImpl.commit(EntityBundleImpl.java:1611)
    at com.guidewire.pl.web.navigation.EditControllerImpl.commitChanges(EditControllerImpl.java:63)
    at com.guidewire.pl.web.navigation.Location.innerCommitChanges(Location.java:476)
    at com.guidewire.pl.web.navigation.Location.commitChanges(Location.java:425)
    at com.guidewire.pl.web.navigation.LocationConfigCodeGen$6.handleCall(LocationConfigCodeGen.java:91)
    at gw.internal.gosu.runtime.GosuRuntimeMethods.invokeMethodInfo(GosuRuntimeMethods.java:252)
    at fragment_.pcffragment.ApprovalDetailWorksheet.ApprovalDetailScreen.ApprovalDetailWorksheet_ApproveButton.ToolbarButton_action_0_6.evaluate(Unknown Source)
    at gw.internal.gosu.parser.fragments.GosuFragment.evaluate(GosuFragment.java:485) - ({
  beforeCommitAction = \  -> Activity.approve()
  CurrentLocation.commit()
hakamairi
  • 4,464
  • 4
  • 30
  • 53

1 Answers1

3

Null Pointer Errors would not occur if there is an authorization or permission issue. This is due to an object not being initialized or passed correctly.

To resolve, you'll need to figure out which object is null. Looking at the logs, the 2 most likely objects are the Activity or CurrentLocation objects. I recommend debugging to confirm if these are initialized.

Also, Guidewire recommends caution with bundles in PCFs. If this is not an OOTB call to CurrentLocation.commit(), I also recommend persisting the Activity at other bundle commit points.

The Guidewire warning is: "Only commit entity changes at appropriate times or you could cause serious data integrity issues. In many cases, such as typical Rule sets and PCF code, it is best to rely on default behavior and not explicitly commit entity data manually."

You can learn more about bundles and database transactions in the Guidewire Documentation here: https://docs.guidewire.com/cloud/bc/202104/integration/gosu/topics/c_ku1456387.html

Note: you may need to login with your customer or partner credentials to access that Documentation link.