BUG FOUND: "Object reference not set to an instance of an object."

BUG FOUND: "Object reference not set to an instance of an object."

  
  1. Publish the "Components" application.
  2. Create an eSpace and consume "Country_GetByCode" via submit button.
  3. An error will occur "Object reference not set to an instance of an object."

Note: if you have a look at the logic code in "Country_GetByCode", the flow contains a simple query to filter for Country.Code=Code, and assigns the result to the output parameter, that is it!

I'm unable to determine the cause of this issue and unable to continue with development.
The logic code is correct, what is wrong with it?

Outsystems Platform: 9.1.400.0

EDIT: full publishing does not help either!
Hi Robert, I notice that 9.1.400.0 was unavailable and replaced to 9.1.401.0 very soon due some instability.
I don´t  know if this could be your issue,but I guess it can help.


Best regards 
Fabio

Tested: on the latest version 9.1.401.0, the error still occurs
Test Results
Country_GetList - Pass
Country_GetByCode - Failed^
Country_GetById - Failed^
Currency_GetByCode - Failed^
Currency_ById - Failed^
CountryState_GetById - Pass

^ Failed with same error message "Object reference not set to an instance of an object."

Conclusion: this issue can be reproduced on outsystems platform 9.1.401.0, it is an internal bug in Outsystems Platform, this issue has nothing to do with the user's logic code. It was found that this issue only occurs on actions that use static entities when referenced/consumed  by an eSpace project. When the action is referenced/consumed within the same eSpace the issue does not occur. Standard entities is not affected in any way they continue to function as usual.
Hi Robert,
Does it means in your application you are not able to refer your static entity in other espace or you found any workaround for that?


Regards,
-PJ-
Pramod "Does it means in your application you are not able to refer your static entity in other espace "

Yes that is correct.but when using it within an action.

You can try this...and it will not work for you either! issue can be reproduced with the following steps
1) Create an eSpace with one action "GetStaticItems"
2) Drag and drop the static entity to the workflow, it will create a simple query
3) Attach the simple query result to the "GetStaticItems" action output parameter
4) Set the action to public

Now try to consume this GetStaticItems action within a separate eSpace, you will receive an error! "
Object reference not set to an instance of an object." try to consume the action within the same eSpace - success!
Hi Robert I follow your instructions using 9.1.400.0 and for me works fine. I created a eSpace with a static entity Colors, then created an action to return a list of Colors, then created another eSpace to consume this action and returned smoothly all the colors of the entity. I cannot reproduce the error following the steps above. 
Thanks for testing Alexandre. I did you try mysql? Test are failing on mysql for me.
Hello Robert I tested with SQL Server. I do not have an installation with MySql.
Hello Alexandre

I tested on MySQL and SQL Server, and two seperate servers and they both fail with the same error message.

Try this
1) Install the components application attached.
2) Create an eSpace "MyTest" 

3) Create a webscreen and in your preparation flow, drag and drop "Country_GetByCode" from the "Lookup" eSpace
4) Open the "MyTest" webscreen that you created - do you get the error? Object reference not set to an instance of an object.

Note: I tested this on a brand new server, and I am getting the same error! 

I've encountered this problem myself.

It only happens when you return a single Record attribute, it does not happen when you return a List, so Alexandre Costa this why you could not reproduce the error.

The problem also does NOT occur if you return only an Id or a Join Record (several entities/structures).

I've only seen it happen in static entities.

Reading a previous Robert C., to reproduce the error the public action has to be consumed by another espace.

Using Service Studio 9.1.501.0, in personal environment, Server 9.1.301.0.


This problem Alexandre Costa wrote:

Hi Robert I follow your instructions using 9.1.400.0 and for me works fine. I created a eSpace with a static entity Colors, then created an action to return a list of Colors, then created another eSpace to consume this action and returned smoothly all the colors of the entity. I cannot reproduce the error following the steps above. 



I believe that I have an open bug ticket on this as well.


J.Ja

Outsystems R&D was able to reproduce this issue and will fix it..... soon.... 

Outsystems's workaround solution: change the output parameter "list" data type to "record list"  data type. You would need to upgrade all your apps, later outsystems will fix this issue and once again you need to do the reverse. 


Unable to fix this myself so I just left it and work on other features and while I wait for outsystems to fix it.