Error: An unexpected exception has occured during CreateInstance
search cancel

Error: An unexpected exception has occured during CreateInstance

book

Article ID: 277013

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite Asset Management Suite Asset Management Solution

Issue/Introduction

While trying to run an AD Import Rule, while it is running and importing the desired resources to the database (in this example, it was an AD Import Rule for Users), the following error happened:

Failed to save messaging resource: '00889709' (0x0 / cacccabb-225a-4611-83ce-5c56bd8de562)

An unexpected exception has occured during CreateInstance.
 Assembly: Altiris.AssetContractCommon, Version=7.0.0.0, Culture=neutral, PublicKeyToken=d516cb311cfb6e4f
 Type: Altiris.AssetContractCommon.Types.ServiceTypeItem
   [AeXClassActivatorException @ Altiris.NS.dll]
   at Altiris.NS.ClassActivator.CreateInstance(string, string, object[])
   at Altiris.NS.ItemManagement.Item.CreateInstance(string, string, object[], Guid)
   at Altiris.NS.ItemManagement.Item.CreateInstance(Guid, object[], Guid)
   at Altiris.NS.ResourceManagement.Resource.CreateInstance(Guid, Guid)
   at Altiris.NS.ResourceManagement.MessagingResource.GetLoadedResourceInstance(out bool)
   at Altiris.NS.ResourceManagement.MessagingResource.SaveImpl(bool)
   at Altiris.Database.RetryActionRequest<>.Perform(bool)
   at Altiris.Database.DatabaseContext<>.PerformWithDeadlockRetryHelper(int, int, bool, Getter<IDatabaseContext>, Action<IDatabaseContext>, Action<DeadlockRetryArgs>, bool, string, string)
   at Altiris.NS.ResourceManagement.MessagingResource.Save(bool, bool)
   at Altiris.NS.ResourceManagement.BatchedResourceSaveRequest.Save(MessagingResource, bool)

Could not load file or assembly 'Altiris.AssetContractCommon, Version=7.0.0.0, Culture=neutral, PublicKeyToken=d516cb311cfb6e4f' or one of its dependencies. The system cannot find the file specified.
   [FileNotFoundException @ mscorlib.dll]
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName, string, Evidence, RuntimeAssembly, ref StackCrawlMark, IntPtr, bool, bool, bool)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName, Evidence, RuntimeAssembly, ref StackCrawlMark, IntPtr, bool, bool, bool)
   at System.Reflection.RuntimeAssembly.InternalLoad(string, Evidence, ref StackCrawlMark, IntPtr, bool)
   at System.Reflection.RuntimeAssembly.InternalLoad(string, Evidence, ref StackCrawlMark, bool)
   at System.Reflection.Assembly.Load(string)
   at Altiris.NS.ClassActivator.LoadAssembly(string, bool)
   at Altiris.NS.ClassActivator.GetType(string, string, bool)
   at Altiris.NS.ClassActivator.CreateInstance(string, string, object[])

Exception logged from:
   at Altiris.Diagnostics.Logging.EventLog.ReportException(int, string, string, Exception, string)
   at Altiris.NS.ResourceManagement.BatchedResourceSaveRequest.Save(MessagingResource, bool)
   at Altiris.NS.ResourceManagement.BatchedResourceSaveRequest.Save(MrGroup, bool)
   at Altiris.NS.ResourceManagement.BatchedResourceSaveRequest.Save(ICollection<MrGroup>, bool)
   at Altiris.NS.ResourceManagement.ResourceImport.MessagingResourceResolver.SaveResources(ResourceImporter)
   at Altiris.NS.ResourceManagement.ResourceImporter.LoadResources(XmlReader)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.SeekResourceImport(string, bool, XmlTextReader, IList<string>, out MessagingResource, out ResourceImporter)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessageImpl(string, bool)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessageInternal(string, bool)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchWithinContext(string, bool, IItem, IItemMessaging, MessageHeader)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchWithinContext(int, IEventQueueRow, EventQueueRowContent, MessageHeader)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.TryDispatch(int, IEventQueueRow, EventQueueRowContent)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatch(IEventQueueRow, out bool, EventQueueDispatcher, EventQueue)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.WorkerDispatchStep(DispatchSlot, IAutoCallContextSnapshot)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatchSlotLoop(DispatchSlot, out string)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatchSlotLoop(IMeasureOperation, DispatchSlot)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchSlotThreadProc(object)
   at System.Threading.ThreadHelper.ThreadStart(object)

-----------------------------------------------------------------------------------------------------
Date: 12/11/2023 4:20:07 AM, Tick Count: 164657437 (1.21:44:17.4370000), Size: 4.33 KB
Process: AeXSvc (6656), Thread ID: 97, Module: Altiris.NS.dll
Priority: 1, Source: ResourceImporter

Environment

ITMS 8.x

Cause

The NS log shows that the following assembly is been called and failing:

 Assembly: Altiris.AssetContractCommon

Asset Management Solution used to be installed in the SMP Server but it was not removed / uninstalled properly.

Resolution

Try the following:

  1. Make sure Asset Management Solution appears as uninstalled. You can use the following query to find what Solutiuons are flagged as Uninstalled:

    --Find all solutions that are currently set to uninstalled
    select distinct i2.Guid, i2.Name, cast (i2.state as xml).value ('(/item/version)[1]', 'nvarchar(100)') as 'Version'
    from Item i
    join Item i2 on i2.Guid = i.ProductGuid
    where i.ProductUninstalled = 1
    order by 3

  2. See if Asset Solution is listed:

    22506AFA-1F15-4728-93CB-32E6F26DDD34 Altiris Asset Management Solution


  3. Then, the simplest way to make sure the referenced assembly is present or gone is to launch SIM (Symantec Installation Manager) and install



    and then remove Asset Management Solution.

 

Note:
If for some reason the mentioned steps above doesn't work, try the following (make sure you have a recent database backup):

--Delete from classbaseclass first
delete from ClassBaseClass
where BaseClassGuid in
        (
               select Guid
               from Class
               where Type like '%Asset%'
        )
or ClassGuid in
        (
               select Guid
               from Class
               where Type like '%Asset%'
        )
 
--Delete from class next
delete from Class
where Type like '%Asset%'

 

Additional Information

"After a failed upgrade, many pages give "Access Denied" or certain items or products do not show in the SMP Console" (KB 217063)
"After installing an upgrade certain items or products do not show in the SMP Console" (KB 184857)