search cancel

Unable to Edit a Computer resource. Exception encountered: System.NullReferenceException: Object reference not set to an instance of an object.

book

Article ID: 175430

calendar_today

Updated On:

Products

IT Management Suite Asset Management Solution

Issue/Introduction

The customer is having an issue when trying to Edit a computer resource. When he goes to Manage>Computers>select a computer>Right-Click>Edit, they get the following warning:

Exception encountered: System.NullReferenceException: Object reference not set to an instance of an object.
at Altiris.AssetContractCommon.Controls.ResourceDetailsEditCtrl.SetDataClassValues()
at Altiris.AssetContractCommon.Controls.ResourceDetailsEditCtrl.DataBind()
at Altiris.AssetContractCommon.Web.Manager.EditCreateResource.Page_Load(Object sender, EventArgs e).
------------------------------------------------------------------------------------------------
Date: 7/15/2019 12:07:12 PM, Tick Count: 212572359 (2.11:02:52.3590000), Size: 669 B
Process: w3wp (13548), Thread ID: 12, Module: Altiris.AssetContractCommon.Web.dll
Priority: 2, Source: Altiris.AssetContractCommon.Web.Manager.EditCreateResource.Page_Load

 

The URL that it is been accessed is something like this:

https://MySMPserver.domain.com/Altiris/AssetContractCommon/Manager/EditCreateResource.aspx?ItemGuid=6d490c

Warning:

Exception encountered: System.NullReferenceException: Object reference not set to an instance of an object.
at Altiris.AssetContractCommon.Controls.ResourceDetailsEditCtrl.SetDataClassValues()
at Altiris.AssetContractCommon.Controls.ResourceDetailsEditCtrl.DataBind()
at Altiris.AssetContractCommon.Web.Manager.EditCreateResource.Page_Load(Object sender, EventArgs e).
------------------------------------------------------------------------------------------------
Date: 7/15/2019 12:07:12 PM, Tick Count: 212572359 (2.11:02:52.3590000), Size: 669 B
Process: w3wp (13548), Thread ID: 12, Module: Altiris.AssetContractCommon.Web.dll
Priority: 2, Source: Altiris.AssetContractCommon.Web.Manager.EditCreateResource.Page_Load

Environment

ITMS 8.5 RU2

Cause

In this particular instance, the customer had some associations for Solutions that were already uninstalled but still associated to the Computer resources. For example: DLP and Barcode.

Resolution

Try the following:

  1. Run the following query to identify data classes that seems to be still active from products that are already uninstalled:
    select dc.Name , rtdc.*
    from ResourceTypeDataClass rtdc
    join DataClass dc on dc.Guid = rtdc.ResourceDataClassGuid
    --where rtdc.ResourceTypeGuid = '493435f7-3b17-4c4c-b07f-c23e7ab7781f'
    where rtdc.ResourceDataClassGuid in
    (select dc.Guid
    from dataclass dc
    left join ItemClass vi on vi.Guid = dc.Guid
    left join item i on i.guid = dc.Guid
    left join class c on c.guid = vi.ClassGuid
    where i.ProductUninstalled = '1')
  2. If you get results from the query above, then remove thjose associations (seem those should not be there in the first place):
    delete from ResourceTypeDataClass
    where ResourceDataClassGuid in
    (select dc.Guid
    from dataclass dc
    left join ItemClass vi on vi.Guid = dc.Guid
    left join item i on i.guid = dc.Guid
    left join class c on c.guid = vi.ClassGuid
    where i.ProductUninstalled = '1')
  3. Refresh your SMP Console and try again to Edit a Computer resource.