Skip to main content

The search criteria Model must contain exactly one property that maps to a Commerce Server profile property defined as a primary, join, or unique key.

Last week I extended Profile System and added One more unique key for the User Object.
I had done this many times in past and was an easy and simple job but not this time ( because of my silly mistake ).

I had created database field, added Data Member, property in profile definition & finally updated Metadatadefinition file to map to the new field.

image

image

When I queried user object with MCCF by the Key SSN, I got following error.

An exception of type ‘Microsoft.Commerce.Providers.Exceptions.InvalidOperationRequestException’ occurred and was caught.
————————————————————————————————————————
12/21/2010 03:28:37
Type : Microsoft.Commerce.Providers.Exceptions.InvalidOperationRequestException, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Message : The operation could not be performed because the search criteria Model is not valid. The search criteria Model must contain exactly one property that maps to a Commerce Server profile property defined as a primary, join, or unique key.
Source : Microsoft.Commerce.Providers
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void ValidateSearchCriteria(Microsoft.Commerce.Contracts.Messages.CommerceModelSearch)
Stack Trace : at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.ValidateSearchCriteria(CommerceModelSearch searchCriteria)
at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.GetMatches(CommerceModelSearch searchCriteria, Nullable`1& totalItemCount, Boolean throwIfNotFound)
at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.GetMatches(CommerceModelSearch searchCriteria, Nullable`1& totalItemCount)
at Microsoft.Commerce.Providers.Components.ProfileLoaderBase.ExecuteQuery(CommerceQueryOperation queryOperation, OperationCacheDictionary operationCache, CommerceQueryOperationResponse response)
at Microsoft.Commerce.Providers.Components.OperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Broker.OperationSequence.ExecuteComponentTree(List`1 executionTreeList, CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Broker.OperationSequence.Execute(CommerceOperation operation)
at Microsoft.Commerce.Broker.MessageHandler.ProcessMessage(String messageHandlerName, CommerceOperation operation)
at Microsoft.Commerce.Broker.OperationService.InternalProcessRequest(CommerceRequest request)
at Microsoft.Commerce.Broker.OperationService.ProcessRequest(CommerceRequest request)
Additional Info:

MachineName : VPC-MYMachine-BASE
TimeStamp : 12/21/2010 9:28:37 AM
FullName : Microsoft.Commerce.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : /LM/W3SVC/483061927/ROOT-1-129373971773508707
ThreadIdentity :
WindowsIdentity : VPC-MYMachine-BASE\Administrator

I recheck that all the bindings are correct and the property is defined as Unique Key. Every thing seems to be OK but still I was facing error. 🙁

On a closer look I found that I had made a mistake with the group name in the MetadataDefinition file.
The name of the CS Property is case sensitive and my MetadataDefinition file was not in Sync with the Case in Commerce Server Manager.

image

image

Change To

image

I faced the same error On my initial trial of extending profile system when CS 2009 CTP was release ( around 2 year back ) and I had made the same mistake of case. Thus I decided to document the issue and the solution.

The Execute method of job definition “SPSolutionDeploymentJobDefinition” threw an exception, Value cannot be null.

I have developed an Timer Job Definition,feature & feature receiver to create the timer job.

On WSP deployment on my local machine it install with no issue 🙂

Now when deploying on the WebFarm environment with a Front end server , I faced following error.

The Execute method of job definition “SPSolutionDeploymentJobDefinition” (id “030bb074-94a8-4f5d-bf34-b4ca735c1693”) threw an exception. Failed to create feature receiver object from assembly “Company.Project.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1f12345e9c67bc89”, type “Company.Project.Business.EventReceivers.MyTimerJobFeatureReceiver” for feature C0857DB8-1636-11E0-AC62-40DFDED72085: System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Initially I thought It is something wrong with the Event Receiver Class and the application could not find the class. Changed the scope of Class, changed the name of the class, restarted IIS, But I no result.

After two hours of troubleshooting, I restarted