2

We are getting the below error message when trying to read content that has href tag and results in bad request.

15:08:57.712 [ajp-nio-9014-exec-1] DEBUG o.s.c.a.ClassPathScanningCandidateComponentProvider - Identified candidate component class: URL [jar:file:/u01/websites/gbk/WEB-INF/lib/dxa-data-model-2.0.0.jar!/com/sdl/dxa/api/datamodel/model/util/ListWrapper$RichTextDataListWrapper.class] 15:08:57.746 [ajp-nio-9014-exec-1] DEBUG o.s.web.client.RestTemplate - Setting request Accept header to [application/json, application/*+json] 15:08:59.668 [ajp-nio-9014-exec-1] DEBUG o.s.web.client.RestTemplate - GET request for "http://10.40.6.23:8998/ModelService/PageModel/tcm/27//en/about-us/contact-us?includes=INCLUDE" resulted in 200 (null) 15:08:59.670 [ajp-nio-9014-exec-1] DEBUG o.s.web.client.RestTemplate - Reading [class com.sdl.dxa.api.datamodel.model.PageModelData] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@61a760aa] 15:08:59.707 [ajp-nio-9014-exec-1] DEBUG c.s.d.a.d.j.ModelDataTypeIdResolver - Found id = List`1 which we don't know, create a content holder to just save the data 15:08:59.713 [ajp-nio-9014-exec-1] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [public java.lang.String com.sdl.dxa.modules.generic.controller.GenericPageController.handleGetPage(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON document: Unexpected character ('m' (code 109)): was expecting comma to separate Array entries at [Source: (PushbackInputStream); line: 1, column: 4049] at [Source: (PushbackInputStream); line: 1, column: 4024] (through reference chain: com.sdl.dxa.api.datamodel.model.PageModelData["Regions"]->java.util.ArrayList[1]->com.sdl.dxa.api.datamodel.model.RegionModelData["Entities"]->java.util.ArrayList[0]->com.sdl.dxa.api.datamodel.model.EntityModelData["Content"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected character ('m' (code 109)): was expecting comma to separate Array entries at [Source: (PushbackInputStream); line: 1, column: 4049] at [Source: (PushbackInputStream); line: 1, column: 4024] (through reference chain: com.sdl.dxa.api.datamodel.model.PageModelData["Regions"]->java.util.ArrayList[1]->com.sdl.dxa.api.datamodel.model.RegionModelData["Entities"]->java.util.ArrayList[0]->com.sdl.dxa.api.datamodel.model.EntityModelData["Content"]) 15:08:59.714 [ajp-nio-9014-exec-1] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [public java.lang.String com.sdl.dxa.modules.generic.controller.GenericPageController.handleGetPage(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON document: Unexpected character ('m' (code 109)): was expecting comma to separate Array entries at [Source: (PushbackInputStream); line: 1, column: 4049] at [Source: (PushbackInputStream); line: 1, column: 4024] (through reference chain: com.sdl.dxa.api.datamodel.model.PageModelData["Regions"]->java.util.ArrayList[1]->com.sdl.dxa.api.datamodel.model.RegionModelData["Entities"]->java.util.ArrayList[0]->com.sdl.dxa.api.datamodel.model.EntityModelData["Content"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected character ('m' (code 109)): was expecting comma to separate Array entries at [Source: (PushbackInputStream); line: 1, column: 4049] at [Source: (PushbackInputStream); line: 1, column: 4024] (through reference chain: com.sdl.dxa.api.datamodel.model.PageModelData["Regions"]->java.util.ArrayList[1]->com.sdl.dxa.api.datamodel.model.RegionModelData["Entities"]->java.util.ArrayList[0]->com.sdl.dxa.api.datamodel.model.EntityModelData["Content"])

One of the components' preview looks like this

"fullContent": {
      "$type": "ContentModelData",
      "paraContent": {
        "$type": "List`1",
        "$values": [
          {
            "Fragments": [
              "Email us<span><a href=\"mailto:[email protected]\" target=\"_blank\">[email protected]</a></span>"
            ]
          },
          {
            "Fragments": [
              "Telephone<span><a href=\"tel:+0123456789\">+01234567890</a></span>"
            ]
          },
          {
            "Fragments": [
              "Mailing Address<span>Address Line 1,P.O. Box, Queens 12, Kuwait</span>"
            ]
          }
        ]
      }
    }
  },
2
  • How does the Page’s JSON look (if you preview the Page in the CME)? In particular the Rich Text field? Jun 20, 2018 at 20:24
  • @RickPannekoek I have added the RichTextFields
    – Rache
    Jun 21, 2018 at 11:19

1 Answer 1

2

OK, the JSON fragment reveals the problem: the "$type": "List``1" is not expected (it should be "$type": "RichTextData[]"); you can see that in the exception message: "ModelDataTypeIdResolver - Found id = List`1 which we don't know".

This is an issue in the DXA 2.0 TBBs, which seems to have been fixed in code already: https://github.com/sdl/dxa-content-management/commit/a2c209d63a0685e74d2015fa83d8b30d1befc64c

This is a kind of hotfix on the DXA 2.0 TBBs, but a DXA 2.0.1 hotfix release has not been created, so you will have to build the TBBs yourself from code to get this fixed. Alternatively, you can contact SDL Support to see if you can get this hotfix.

6
  • @rick is the hotfix you mentioned same as R2DataModelCandidateFix.zip provided to us recently by SDL support for case ID: 00353092? Jun 22, 2018 at 9:00
  • @rick is the hotfix you mentioned same as R2DataModelCandidateFix.zip provided to us recently by SDL support for case ID: 00353092? Jun 22, 2018 at 9:00
  • @Husain - I’m not sure (not that close to the fire anymore), but it seems a candidate hotfix has indeed been provided to a customer. Jun 23, 2018 at 8:35
  • Hmmm, after inspecting the mentioned code change more carefully, I’m wondering if this defective behavior is actually caused rather than fixed by that code change. Jun 23, 2018 at 8:47
  • @RickPannekoek thanks for confirming. I also had similar thoughts. Jun 24, 2018 at 7:16

Your Answer

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

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