Skip to Content
0
Sep 13, 2007 at 10:04 AM

MDM API SP05 :RetrieveLimited Records.execute() throws NullPointerException

14 Views

Hi,

I am working on MDM Java API on SP05 server (5.5.42.57) , performing a search to retrieve a main table record having fields of type "Lookup[Qualified Flat](multi-valued)" and Lookup[Flat] fields apart from general text fields.

<b>RetrieveLimitedRecordsCommand on execute is throwing a NullPointerException</b>;

//Instantiate search command

RetrieveLimitedRecordsCommand retrieveLimitedRecordsCommand =

new RetrieveLimitedRecordsCommand(con);

retrieveLimitedRecordsCommand.setSession(

authenticateUserSessionCommand.getSession());

//Supply the result definitions and the search as argument to the command.

retrieveLimitedRecordsCommand.setResultDefinition(rd);

retrieveLimitedRecordsCommand.setSearch(search);

retrieveLimitedRecordsCommand.setSupportingResultDefinitions(supportingRd);

//Execute the command

try

{

System.out.println("Inside the try block");

<b>retrieveLimitedRecordsCommand.execute();</b>

<b>I get the error as</b>

<i>"Inside the try block

java.lang.NullPointerException

at com.sap.mdm.internal.commands.ResultDefinitionHelper.convertFrom(ResultDefinitionHelper.java:32)

at com.sap.mdm.internal.commands.ResultDefinitionHelper.convertFrom(ResultDefinitionHelper.java:45)

at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.getProtoTableRequest(RetrieveLimitedRecordsCommand.java:189)

at com.sap.mdm.data.commands.AbstractRetrieveLimitedRecordsCommand.execute(AbstractRetrieveLimitedRecordsCommand.java:126)

at com.sap.mdm.data.commands.RetrieveLimitedRecordsCommand.execute(RetrieveLimitedRecordsCommand.java:157)

at com.sap.mdm.examples.CreateConnection.<b>searchKeyword</b>(CreateConnection.java:347)

at com.sap.mdm.examples.CreateConnection.main(CreateConnection.java:107)

java.lang.NullPointerException"</i>

"<b>supportingRd</b>" resultDefinition is an array of resultDefinition's of the lookup table and QualifiedLookup tables is set properly, immidietly after entering the try block and printing the message a fatal exception is thrown,

<b>searchKeyword</b> is the method in which the above code executes

help me resolve this 😕

Paras