FileDocument.setContents throws exception from Java action

Hello guys, I have an entity which inherits System.FileDocument, I'm passing it as parameter to Java action, let's say the object parameter called entity, from Java action I'm doing : entity.setContents(.....). when I'm calling this method; I'm getting SQLSyntaxException java.sql.SQLSyntaxErrorException: ORA-00904: "id": invalid identifier Note:My entity is empty, means I don't have any extra attribute in my Entity.
1 answers

I have used this with success. Hope it helps

FileDocument document = FileDocument.create(context);
InputStream inputStream = IOUtils.toInputStream("<xml></xml>");
Core.storeFileDocumentContent(context, document.getMendixObject(), inputStream);

I use the system context

private IContext context = Core.createSystemContext();