We are using SDL Web 8.5 and DXA 2.0 Java Version. We are getting below error in DXA log file while accessing any page:

ERROR c.s.w.c.i.mapping.SemanticMapperImpl - Exception while getting field data for: private java.util.List com.sdl.dxa.modules.onlineforms.model.OnlineFormFields.fieldValidations
com.sdl.webapp.tridion.fields.exceptions.UnsupportedTargetTypeException: Unsupported target class: com.sdl.dxa.modules.onlineforms.model.ValidationMessages
    at com.sdl.dxa.tridion.mapping.converter.source.keyword.Converter.getConverter(Converter.java:43)
    at com.sdl.dxa.tridion.mapping.converter.KeywordModelDataConverter.convert(KeywordModelDataConverter.java:24)
    at com.sdl.dxa.tridion.mapping.converter.KeywordModelDataConverter.convert(KeywordModelDataConverter.java:15)
    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)
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:693)
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:673)
    at com.sdl.webapp.common.impl.mapping.SemanticMapperImpl.createEntity(SemanticMapperImpl.java:105)
    at com.sdl.dxa.tridion.mapping.converter.ContentModelDataConverter.convert(ContentModelDataConverter.java:36)
    at com.sdl.dxa.tridion.mapping.converter.ContentModelDataConverter.convert(ContentModelDataConverter.java:19)
    at com.sdl.dxa.tridion.mapping.converter.GenericSemanticModelDataConverter.convert(GenericSemanticModelDataConverter.java:65)
    at com.sdl.dxa.tridion.mapping.converter.ListWrapperConverter.convertValue(ListWrapperConverter.java:59)
    at com.sdl.dxa.tridion.mapping.converter.ListWrapperConverter.convert(ListWrapperConverter.java:38)
    at com.sdl.dxa.tridion.mapping.converter.ListWrapperConverter.convert(ListWrapperConverter.java:19)
    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)
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:693)
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:673)
    at com.sdl.webapp.common.impl.mapping.SemanticMapperImpl.createEntity(SemanticMapperImpl.java:105)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.createViewModel(DefaultModelBuilder.java:157)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.buildEntityModel(DefaultModelBuilder.java:123)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:86)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:73)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.createEntityModel(DefaultModelBuilder.java:360)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.lambda$createRegionModel$10(DefaultModelBuilder.java:342)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.createRegionModel(DefaultModelBuilder.java:345)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.lambda$buildPageModel$8(DefaultModelBuilder.java:266)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.buildPageModel(DefaultModelBuilder.java:267)
    at com.sdl.dxa.tridion.mapping.impl.ModelBuilderPipelineImpl.createPageModel(ModelBuilderPipelineImpl.java:59)
    at com.sdl.dxa.tridion.mapping.impl.DefaultContentProvider._loadPage(DefaultContentProvider.java:104)
    at com.sdl.dxa.tridion.mapping.impl.DefaultContentProvider.getPageModel(DefaultContentProvider.java:175)
    at com.sdl.webapp.common.controller.PageController.getPageModel(PageController.java:290)
    at com.sdl.webapp.common.controller.PageController.handleGetPage(PageController.java:119)
    at com.sdl.dxa.modules.generic.controller.GenericPageController.handleGetPage(GenericPageController.java:123)
    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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:193)
    at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:322)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

what could be the reason for this error

we have created an include page for all the online calculators (all calculators are based on OnlineForm schema) and added that page in our custom page template.

ValidationMessages Schema And Model Class

enter image description here

@SemanticEntity(entityName = "ValidationMessages", vocabulary = SDL_CORE, prefix = "vm")
@Data
@EqualsAndHashCode(callSuper = true)
public class ValidationMessages extends AbstractEntityModel {

    @SemanticProperty("vm:msgKey")
    @JsonProperty("MsgKey")
    private Tag msgKey;

    @SemanticProperty("vm:msgValue")
    @JsonProperty("MsgValue")
    private String msgValue;

}

Additional Schemas and Classes

ValidationMessages is an embeddable schema and we are using this schema in another embeddable schema "OnlineFormFields".

enter image description here

@SemanticEntity(entityName = "OnlineFormFields", vocabulary = SDL_CORE, prefix = "off")
@Data
@EqualsAndHashCode(callSuper = true)
public class OnlineFormFields extends AbstractEntityModel {

    @SemanticProperty("off:fieldValidations")
    @JsonProperty("FieldValidations")
    private List<ValidationMessages> fieldValidations;

}


@SemanticEntity(entityName = "OnlineForm", vocabulary = SDL_CORE, prefix = "of")
@Data
@EqualsAndHashCode(callSuper = true)
public class OnlineForm extends AbstractEntityModel {

    @SemanticProperty("of:formFields")
    @JsonProperty("FormFields")
    private List<OnlineFormFields> formFields;
}
  • 1
    Please include more information, was it working at any point in time, is this a a custom implementation or the example site, etc. – Atila Sos Aug 9 at 10:42
  • In particular, the exception is about the View Model property OnlineFormFields.fieldValidations which is referring to type ValidationMessages. Please include how these View Models are defined. – Rick Pannekoek Aug 9 at 17:19
  • @RickPannekoek we have included more detail can u please check where we are doing wrong – Abdul Qadir Sep 25 at 8:32

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.