Support Article

NullPointerException Executing RD via data flow

SA-38502

Summary



NullPointerException while executing RD via data flow.

Error Messages



Error on node [22a782c2b099335c460ec166e0b0c932] com.pega.dsm.dnode.api.dataflow.StageException: Exception in stage: LeadScoringContactsWithRecentActivities at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageOutputSubscriber.onError(DataFlowStage.java:528) at com.pega.dsm.dnode.api.dataflow.DataFlowStage$StageInputSubscriber.onError(DataFlowStage.java:391) at com.pega.dsm.dnode.api.dataflow.DataFlowInput$1$1$1.onError(DataFlowInput.java:74) at com.pega.dsm.dnode.impl.stream.DataObservableImpl$SafeDataSubscriber.onError(DataObservableImpl.java:293) at com.pega.dsm.dnode.impl.stream.DataObservableImpl$SafeDataSubscriber.subscribe(DataObservableImpl.java:332) at com.pega.dsm.dnode.impl.stream.DataObservableImpl.subscribe(DataObservableImpl.java:53) at com.pega.dsm.dnode.impl.stream.DataObservableImpl$2.emit(DataObservableImpl.java:149) at com.pega.dsm.dnode.impl.stream.DataObservableImpl$SafeDataSubscriber.subscribe(DataObservableImpl.java:326) at com.pega.dsm.dnode.impl.stream.DataObservableImpl.subscribe(DataObservableImpl.java:53) at com.pega.dsm.dnode.api.dataflow.DataFlow$6.run(DataFlow.java:496) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at com.pega.dsm.dnode.util.PrpcRunnable$1.run(PrpcRunnable.java:44) at com.pega.dsm.dnode.util.PrpcRunnable$1.run(PrpcRunnable.java:41) at com.pega.dsm.dnode.util.PrpcRunnable.execute(PrpcRunnable.java:52) at com.pega.dsm.dnode.impl.prpc.PrpcThreadFactory$PrpcThread.run(PrpcThreadFactory.java:84) Caused by: com.pega.dsm.dnode.api.DNodeException: Could not perform database dataset operation on PegaSFA-Entity-Contact at com.pega.dsm.dnode.impl.dataset.database.DatabaseOperationsUtil$1.emit(DatabaseOperationsUtil.java:85) at com.pega.dsm.dnode.impl.stream.DataObservableImpl$SafeDataSubscriber.subscribe(DataObservableImpl.java:326) ... 11 more Caused by: java.lang.NullPointerException at com.pega.pegarules.data.internal.rd.utils.DatabaseUtils.getPropertyTypeForColType(DatabaseUtils.java:454) at com.pega.pegarules.data.internal.sqlapi.resolve.NativeSQLAPIResolver.getColumnInfoFromTable(NativeSQLAPIResolver.java:1151) at com.pega.pegarules.data.internal.sqlapi.resolve.NativeSQLAPIResolver.resolveFilterValueLiteral(NativeSQLAPIResolver.java:725) at com.pega.pegarules.data.internal.sqlapi.resolve.NativeSQLAPIResolver.resolveFilters(NativeSQLAPIResolver.java:700) at com.pega.pegarules.data.internal.sqlapi.resolve.NativeSQLAPIResolver.resolve(NativeSQLAPIResolver.java:138) at com.pega.dsm.dnode.util.NativeSQLBatchReader.(NativeSQLBatchReader.java:90) at com.pega.dsm.dnode.impl.dataset.database.DatabaseOperationsUtil.readFromDatabase(DatabaseOperationsUtil.java:140) at com.pega.dsm.dnode.impl.dataset.database.DatabaseBrowseAllOperation$1.executeExposedLogic(DatabaseBrowseAllOperation.java:96) at com.pega.dsm.dnode.impl.dataset.database.DatabaseOperationsUtil$1.emit(DatabaseOperationsUtil.java:78) ... 12 more


Steps to Reproduce

  1. Create a data flow wthr RD as source.
  2. Go to Actions --> Run
  3. Click on Start.
  4. When DF running, we see Error(Click on Details link).

Not seeing any errors when report definition is run directly.

Root Cause



A defect in Pegasystems’ code or rules. This issue occurs when we have a filter (where) condition with LHS as a Subreport column with an aggregate function and the RHS is a Literal. If the RHS is not a literal then this issue will not occur.

This is because, to determine the property type of the RHS, we need to know the property type of the LHS by taking the column name.
Since with an aggregate function the column name is changed to alias name, the alias name is not found in the tableInfo as a valid column name. Hence, during resolution itself there is a NullPointerException.


Resolution



Use associations instead of subreports in RD . If you use associations you may get the below exception

BadTableMappingException in following method

com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.setStmtInsert(String, ClipboardProperty, Column, DataStorePreparedStatement, int, boolean, String, DataStoreTableKey, IPRThread, boolean)

The query fails when RD has a function in RHS that takes an integer value(2) as a function parameter and in LHS it is going as a string (ex""2"").So for that issue please apply below hot fix

Apply HFix-34315

Published May 25, 2017 - Updated May 29, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.