Get content with ContentService fails

Hi,
I want to store a JsonContentProperty with a page. In order to use the corresponding builder, I need the content object of the page. I am using

Content pageContent = contentService.find().withId(page.getContentEntityObject().getContentId()).fetchOneOrNull();

The page definitely exists, but pageContent is nevertheless null. I have no clue why! Any tip?

Thanks
Tuelle

Hi @ttwellmann,

This looks similar to this post. There’s a sample code in the comments and a suggested approach when injecting contentService.

If I assumed incorrectly and the link is not relevant, kindly post your class and the error you are getting. Thanks.

Cheers,
Ian