I am trying to access the entries and nodes of our catalog but get the error below. The endpoints not related to the catalog work just fine.
Any advice ?
"Message": "An error has occurred.",
"ExceptionMessage": "Object reference not set to an instance of an object.",
"StackTrace": " at EPiServer.UriSupport.AbsoluteUrlBySettings(String path)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.MetaDataModelFactory.GetVirtualPath(String assetKey, Boolean thumbnaill)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.MetaDataModelFactory.d__6.MoveNext()
\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.EntryModelFactory.InitializeCollections(Entry model, Entry entry, String language, MetaClass metaClass, CatalogDto catalog)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.EntryModelFactory.CreateEntryModel(Entry entry, String language)
\n at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.EntryModelFactory.CreateEntriesModel(String languageCode, Int32 startPage, Int32 pageSize)
\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.EntryController.GetCatalogEntries(Int32 startPage, Int32 pageSize)
\n at lambda_method(Closure , Object , Object )
\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object methodParameters)
\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
\n--- End of stack trace from previous location where exception was thrown ---
It sounds like you need to add wildcard host name to your site definition
Thanks, but can you be a bit more specific ?
I guess it is a screenshot but the link is broken.
Hmm, it worked for me. Please try again now
Quan, I don't see a screenshot or a link either.
Dạmn.. It seems the file is ok for a while then it was deleted. Will check with World team tomorrow. On phone, can't really do anything now
@David: Sorry for the confusion, here's how to add the wildcard hostname
Thanks, it worked!
I already had the wildcard set for my web site. The only difference was that the culture was set on the wilcard but not on the hostname. I added the culture on both, then it worked.