Did you try to search for this error because there are a lot of other people that have had the same one and all of them were related to emulate cloud security.
Try turning that off. Allthough you will have to keep in mind that if the code is to run on the Mendix cloud it could be problematic.
If you want to store an image to a mendix object (which inherits from system.image) use Core.storeImageDocumentContent in Java.
Since this is in 4.2.2. Could the new security tab (Project/Security File Access tab) have an influence? May be somebody from Mendix could give a answer if this could produce this behaviour.
You should never set "setPublicThumbnailPath", its an internal property for the runtime. As stephan indicated you should use Core.storeImageDocumentContent.
The exception is probably caused by "emulate cloud security". Applications are not allowed to read files outside their own project directory by default.