NullPointerException on putting content to existing page via REST API

Hello,

We are running XWiki Debian 16.8.0 (xwiki-xjetty-mariadb) and currently testing it to migrate from Confluence.
We need to adjust pages content after data conversion.
There is no problem with getting a page via API, but putting changed content fails with the following log output

java.lang.NullPointerException: Cannot invoke "org.xwiki.rest.model.jaxb.Page.getContent()" because "restPage" is null
        at org.xwiki.rest.internal.ModelFactory.toDocument(ModelFactory.java:193)
        at org.xwiki.rest.internal.resources.pages.ModifiablePageResource.putPage(ModifiablePageResource.java:55)
        at org.xwiki.rest.internal.resources.pages.PageResourceImpl.putPage(PageResourceImpl.java:70)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)

Could it be an issue introduced in the recent versions? Because previously it was working, not sure about version, but it was about a year ago.

The stacktrace indicates that the call to putPage() is passing a null object in the Page parameter.

The Page parameter represents the content of the request, transformed automatically from XML to a Java Page object. Since it’s null, it could indicate that you’re passing some empty XML as input.

Could you check this? And show us your REST call maybe.

Thx

Might have something to do with the move to Jersey in XWiki 16.2.

Could you give more details on what you are exactly doing from HTTP point of view.

Guys, thank you for the quick response. I’ve solved my problem by switching API URL to https.
Sorry for confusion.