0

DXA 2.2 "Schema Id must not be null" using dynamic component template.

{
   "Id":"193303-193302",
   "Namespace":"tcm",
   "ComponentTemplate":{
      "Id":"193302",
      "Namespace":"tcm",
      "Title":"ESB",
      "RevisionDate":"2020-04-28T13:59:34.79",
      "OutputFormat":"HTML Fragment",
      "Metadata":{
         "view":"ESB"

}

},
   "Folder":{
      "Id":"8540",
      "Title":"Content"

},
   "Content":{
      "PlanText":"test dxa 2.2 esb Dynamic"

},
   "MvcData":{
      "ViewName":"ESB"

},
   "XpmMetadata":{
      "ComponentID":"tcm:83-193303",
      "ComponentModified":"2020-04-23T15:50:57.253",
      "ComponentTemplateID":"tcm:83-193302-32",
      "ComponentTemplateModified":"2020-04-28T13:59:34.79",
      "IsRepositoryPublished":true

},
   "SchemaId":"193301"
}

The website shows "Schema Id must not be null"

However, the static component template with the same component renders fine. what's missing in the dynamic component template? thanks!

adding--------------------------------------------------------

the propose is rendering with a dynamic component template with DXA 2.2

site log:

2020-04-28 10:12:32,825 [84] ERROR - Sdl.Web.Common.DxaException: Schema Id must not be null.
   at Sdl.Web.Common.Configuration.LocalizationMappingsManager.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\LocalizationMappingsManager.cs:line 62
   at Sdl.Web.Common.Configuration.Localization.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\Localization.cs:line 315
   at Sdl.Web.Common.Mapping.SemanticMapping.GetSchema(String id, Localization loc) in C:\SDL\sample\Sdl.Web.Common\Mapping\SemanticMapping.cs:line 70
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.BuildEntityModel(EntityModel& entityModel, EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 174
   at Sdl.Web.Tridion.Mapping.ModelBuilderPipeline.CreateEntityModel(EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\ModelBuilderPipeline.cs:line 157
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.CreateRegionModel(RegionModelData regionModelData, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 876
Sdl.Web.Common.DxaException: Schema Id must not be null.
   at Sdl.Web.Common.Configuration.LocalizationMappingsManager.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\LocalizationMappingsManager.cs:line 62
   at Sdl.Web.Common.Configuration.Localization.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\Localization.cs:line 315
   at Sdl.Web.Common.Mapping.SemanticMapping.GetSchema(String id, Localization loc) in C:\SDL\sample\Sdl.Web.Common\Mapping\SemanticMapping.cs:line 70
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.BuildEntityModel(EntityModel& entityModel, EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 174
   at Sdl.Web.Tridion.Mapping.ModelBuilderPipeline.CreateEntityModel(EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\ModelBuilderPipeline.cs:line 157
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.CreateRegionModel(RegionModelData regionModelData, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 876
2020-04-28 10:12:33,088 [84] ERROR - Error initializing the ContextServiceClaimsProvider.
2020-04-28 10:13:29,541 [69] ERROR - Sdl.Web.Common.DxaException: Schema Id must not be null.
   at Sdl.Web.Common.Configuration.LocalizationMappingsManager.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\LocalizationMappingsManager.cs:line 62
   at Sdl.Web.Common.Configuration.Localization.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\Localization.cs:line 315
   at Sdl.Web.Common.Mapping.SemanticMapping.GetSchema(String id, Localization loc) in C:\SDL\sample\Sdl.Web.Common\Mapping\SemanticMapping.cs:line 70
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.BuildEntityModel(EntityModel& entityModel, EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 174
   at Sdl.Web.Tridion.Mapping.ModelBuilderPipeline.CreateEntityModel(EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\ModelBuilderPipeline.cs:line 157
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.CreateRegionModel(RegionModelData regionModelData, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 876
Sdl.Web.Common.DxaException: Schema Id must not be null.
   at Sdl.Web.Common.Configuration.LocalizationMappingsManager.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\LocalizationMappingsManager.cs:line 62
   at Sdl.Web.Common.Configuration.Localization.GetSemanticSchema(String schemaId) in C:\SDL\sample\Sdl.Web.Common\Configuration\Localization.cs:line 315
   at Sdl.Web.Common.Mapping.SemanticMapping.GetSchema(String id, Localization loc) in C:\SDL\sample\Sdl.Web.Common\Mapping\SemanticMapping.cs:line 70
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.BuildEntityModel(EntityModel& entityModel, EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 174
   at Sdl.Web.Tridion.Mapping.ModelBuilderPipeline.CreateEntityModel(EntityModelData entityModelData, Type baseModelType, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\ModelBuilderPipeline.cs:line 157
   at Sdl.Web.Tridion.Mapping.DefaultModelBuilder.CreateRegionModel(RegionModelData regionModelData, Localization localization) in C:\SDL\sample\Sdl.Web.Tridion\Mapping\DefaultModelBuilder.cs:line 876
2020-04-28 10:13:29,624 [69] ERROR - Error initializing the ContextServiceClaimsProvider.
2020-04-28 10:18:04,669 [77] ERROR - Error initializing the ContextServiceClaimsProvider.
8
  • Could you please update your question with full trace logs?, also explain bit more detail on your implementation what exactly you are doing and getting this errror message?
    – Velmurugan
    Commented Apr 28, 2020 at 14:36
  • Did you do a Publish Settings + Admin Refresh after adding the template? Also, see tridion.stackexchange.com/questions/20843/… it might be related
    – Atila Sos
    Commented Apr 28, 2020 at 16:53
  • Check the DXA Page JSON you get back from the (GraphQL) Content Service (assuming you’re using the Content Service with DXA Model Extension, rather than the DXA Model Service). Commented Apr 28, 2020 at 17:14
  • hi Rick, Yes i am using content service, somehow the CP id is 193303-193302, so DXA cannot get the correct model?
    – Lucas Liu
    Commented Apr 28, 2020 at 17:30
  • The '193303-193302' is a composite ID consisting of the ComponentId + TemplateId. The Model Extension (of the Content Service) should expand it automatically and include the appropriate EntityModel into your PageModel
    – Atila Sos
    Commented Apr 28, 2020 at 20:20

1 Answer 1

0

as Rick mentioned dxa model extension wasn't installed. after install dxa model extension solved this issue. thanks Rick quick answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.