Thanks for responding,image = modelFactory.createModel(resource, Image.class);
also, you mentioned image = resource.adaptTo(Image.class);
Both of them are getting null point exceptions.
I am assuming your Annotate modelFactory is not null. It is perfectly initialized.
Since both line doesn't work,...