Hi Roberto,
looking at the exception I see that this method is trying to display a filechooser dialog.
This is not possible for a headless client as you can imagine.
I guess you are trying to create an email with attachment.
Somewhere on the way creating/getting the attachment your method fails and Servoy is displaying the filechooser dialog instead.
Hope this helps.