1

Below is the logs I am getting for a component link field. It is a simple single text field schema (CodeBlock). The component link field returns null. There is no error in schema mapping.

15:47:52.136 [ajp-nio-8214-exec-1] DEBUG c.s.d.t.m.impl.DefaultModelBuilder - Expected class is pre-set to class com.sdl.dxa.modules.generic.model.CodeBlock for model EntityModelData(id=13327, componentTemplate=ComponentTemplateData(id=169, title=null, revisionDate=0001-01-01T00:00:00.000Z, outputFormat=null, metadata=null), linkUrl=, content={code=Your request has been received and a customer service representative will contact you shortly.}, binaryContent=null, externalContent=null)

15:47:52.150 [ajp-nio-8214-exec-1] ERROR c.s.w.c.i.mapping.SemanticMapperImpl - Exception while getting field data for: private com.sdl.dxa.modules.generic.model.CodeBlock com.sdl.dxa.modules.onlineforms.model.OnlineForm.webMessage
com.sdl.webapp.tridion.fields.exceptions.FieldConverterException: Cannot convert a entity model 13327 to class com.sdl.dxa.modules.generic.model.CodeBlock for semantic field webMessage
    at com.sdl.dxa.tridion.mapping.converter.EntityModelDataConverter.convert(EntityModelDataConverter.java:43)
    at com.sdl.dxa.tridion.mapping.converter.EntityModelDataConverter.convert(EntityModelDataConverter.java:17)
    at com.sdl.dxa.tridion.mapping.converter.GenericSemanticModelDataConverter.convert(GenericSemanticModelDataConverter.java:65)
    at com.sdl.dxa.tridion.mapping.impl.DefaultSemanticFieldDataProvider.getFieldData(DefaultSemanticFieldDataProvider.java:135)
    at com.sdl.webapp.common.impl.mapping.SemanticMapperImpl$1.doWith(SemanticMapperImpl.java:126)

Caused by: com.sdl.webapp.common.exceptions.DxaException: Exception happened while creating a entity model from: EntityModelData(id=13327, componentTemplate=ComponentTemplateData(id=169, title=null, revisionDate=0001-01-01T00:00:00.000Z, outputFormat=null, metadata=null), linkUrl=, content={code=Your request has been received and a customer service representative will contact you shortly.}, binaryContent=null, externalContent=null)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.buildEntityModel(DefaultModelBuilder.java:133)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:86)
    at com.sdl.dxa.tridion.mapping.converter.EntityModelDataConverter.convert(EntityModelDataConverter.java:37)
    ... 84 common frames omitted

Caused by: com.sdl.webapp.common.exceptions.DxaException: Cannot get a view model tpe because of semantic mapping exception
    at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getMappedModelTypes(ViewModelRegistryImpl.java:109)
    at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getMappedModelTypes(ViewModelRegistryImpl.java:78)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)

Caused by: com.sdl.webapp.common.api.mapping.semantic.SemanticMappingException: Ambiguous semantic mapping for http://www.sdl.com/web/schemas/core:CodeBlock, found these mappings: [class com.sdl.dxa.modules.generic.model.CodeBlock, class com.sdl.dxa.modules.generic.model.CodeBlock]
    at com.sdl.webapp.common.impl.mapping.SemanticMappingRegistryImpl.getEntityClassByFullyQualifiedName(SemanticMappingRegistryImpl.java:334)
    at com.sdl.webapp.common.impl.model.ViewModelRegistryImpl.getMappedModelTypes(ViewModelRegistryImpl.java:107)
    ... 103 common frames omitted 
1

Could it be that the model is added to your webapp twice? In the last error in the stacktrace, we can see this

Caused by: com.sdl.webapp.common.api.mapping.semantic.SemanticMappingException: Ambiguous semantic mapping for http://www.sdl.com/web/schemas/core:CodeBlock, found these mappings: [class com.sdl.dxa.modules.generic.model.CodeBlock, class com.sdl.dxa.modules.generic.model.CodeBlock]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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