JAXRSUtils: No message body writer has been found for class java.util.Collections$UnmodifiableMap, ContentType: */*

I got a error message I haven’t got before.
2022-05-29 11:59:39.396 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body writer has been found for class java.util.Collections$UnmodifiableMap, ContentType: */*
That has been discused several times in the forum, but I haven’t found the solution for my problem.

I’ on 3.3.0.M5. And I needed to calibrate a rollershutter (Fibaro FGR222 Rollershutter 2). That is needed quite regulary for this specific device so I have a routine programmed, which used to work flawless, but now it did not execute the calibration:

@rule(u"Rollershutter: Kalibrierung")
@when("Item swi_LivingRoom_Shutter_West_Calib received command ON")
@when("Item swi_LivingRoom_Shutter_Terrace_Calib received command ON")
@when("Item swi_LivingRoom_Shutter_South_Calib received command ON")
@when("Item swi_LivingRoom_Shutter_Garden_Calib received command ON")
def RollershutterCalibration(event):
    LOGGER = "Rollershutter: RollershutterCalibration"
    # Kalibrierung des Rolladen-Devices automatisch durchführen

    CalibItem = ir.getItem(event.itemName)
    Window = CalibItem.label[len("Kalibrierung starten: Rolladen "):]

    LogAction.logInfo(LOGGER, u"Rolladen {} wird kalibriert.".format(Window))

    # ZWave-Kommando für Kalibrierung zusammenstellen
    Node = 0
    if Window == "West":
        Node = 4
    if Window == "Terrasse":
        Node = 5
    if Window == u"Süd":
        Node = 6
    if Window == "Garten":
        Node = 7

    if Node == 0:
        LogAction.logInfo(LOGGER, u"Kalibrierung fehlgeschlagen: Node unbekannt für Fenster {}".format(Window))
        return

    # Device-Namen URL-tauglich machen
    Device = "zwave%3Adevice%3Agehirn%3Anode" + str(Node)
    Login = RESTUserLogin + ":" + RESTUserPasswd + "@"
    Service = openhabHost + ":" + openhabPort
    HTTPString = "http://" + Login + Service + "/rest/things/" + Device + "/config"

    # Kalibrierungs-Befehl triggern
    Parameter = "{\"config_29_1\": 1}"
    HTTP.sendHttpPutRequest(HTTPString, "application/json", Parameter)

    sleep(15)

    # Funktion wieder freigeben
    events.sendCommand(CalibItem, OFF)

    # Kalibrierungs-Befehl zurücksetzen (falls noch aktiv)
    Parameter = "{\"config_29_1\": 0}"
    HTTP.sendHttpPutRequest(HTTPString, "application/json", Parameter)

    return

This caused the following errors:

2022-05-29 11:59:39.365 [INFO ] [lershutter: RollershutterCalibration] - Rolladen Garten wird kalibriert.
2022-05-29 11:59:39.396 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body writer has been found for class java.util.Collections$UnmodifiableMap, ContentType: */*
2022-05-29 11:59:54.434 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body writer has been found for class java.util.Collections$UnmodifiableMap, ContentType: */*

In the zwave debug log I got:

2022-05-29 11:59:39.385 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Configuration update received
2022-05-29 11:59:54.424 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 7: Configuration update received

Later I started the calibration directly from OH UI by modifying the thing parameter there. That worked, but not my rule.

Your http call seems to specify Content-Type for put request but miss Accept header. Make sure both are set for updates you send to server.

Look closer at http helpers, they probably have different set of parameters for get/post/put calls.

I ran into this problem yesterday while trying to run a heal using the REST API.

In addition to the config parameter you want to change (in my case "action_heal": true), I also needed to include the node_id in the payload (e.g. "node_id": 7). I don’t know when it changed to require the node_id, but it never was required previously.

So my payload looked like this.

{ "action_heal": true, "node_id": 7 }

I should add that it took me a couple hours to figure this out. :sob: :sob: :sob:

1 Like

Thanks a lot.
Strange, but adding the node_id as a parameter was the solution!

2 Likes

Nice!

It drove me absolutely crazy yesterday trying to figure out what was wrong…

1 Like

Thanks for sharing! I’ve just came across this problem as well after upgrade from 3.2.0 to 3.3.0 stable. But I didn’t noticed anything in the breaking changes.

1 Like

I spent hours … thanks for posting this!!