1

I have created the BinaryItem extending MediaItem in DXA 2.0 but BinaryItem class is giving me this error whle creating the entity model

20:13:57.831 [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.BinaryItem for model EntityModelData(id=533, componentTemplate=null, linkUrl=, content=null, binaryContent=null, externalContent=null)
20:13:57.843 [ajp-nio-8214-exec-1] WARN  c.s.d.t.m.impl.DefaultModelBuilder - Cannot create an entity model for model data EntityModelData(id=534-538, componentTemplate=null, linkUrl=, content={heading=Gulf Bank Logo, media=EntityModelData(id=533, componentTemplate=null, linkUrl=, content=null, binaryContent=null, externalContent=null), targetURL={targetFrame=KeywordModelData(id=405, description=Self, key=, taxonomyId=117, title=01 - Self), alternateText=Gulf Bank, linkText=Gulf Bank Logo, style=brand, internalLink=EntityModelData(id=720, componentTemplate=null, linkUrl=/en/personal, content=null, binaryContent=null, externalContent=null)}, introduction=Gulf Bank Logo}, binaryContent=null, externalContent=null)
java.lang.NumberFormatException: null
    at java.lang.Long.parseLong(Long.java:552)
    at java.lang.Long.parseLong(Long.java:631)
    at com.sdl.dxa.tridion.mapping.impl.DefaultModelBuilder.buildEntityModel(DefaultModelBuilder.java:106)
    at com.sdl.da.tridion.mapping.impl.ModelBuilderPipelineImpl.createEntityModel(ModelBuilderPipelineImpl.java:86)
    at com.sdl.dxa.tridion.mapping.converter.EntityModelDataConverter.convert(EntityModelDataConverter.java:37)
    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)
    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$createRegionModel$9(DefaultModelBuilder.java:335)
    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:336)
    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:49)
    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 com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:291)
    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.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)

BinaryItem.class code:

@SemanticEntity(entityName = "BinaryImage", vocabulary = SCHEMA_ORG, prefix = "bi", public_ = true)
@Slf4j
@Data
@EqualsAndHashCode(callSuper = true)
public class BinaryItem extends MediaItem 

    @SemanticProperty("bi:alternateText")
    @JsonProperty("AlternateText")
    private String alternateText;

    @SemanticProperty("bi:width")
    @JsonProperty("Width")
    private String width;

    @SemanticProperty("bi:height")
    @JsonProperty("Height")
    private String height;

Your Answer

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

Browse other questions tagged or ask your own question.