Thanks you @Jörg_Hoh It worked I wasn't specifying the right path to the ressource, now it works, I didn't add "imageform/items/item1" in the ressource.ImageFormItem imgFormItem = aemContext.resourceResolver().getResource("/content/imageform/items/item1").adaptTo(ImageFormItem.class);