Invalid argument issue when trying to send an email via the BO platform
I am currently developing an application that should be able to send an email to certain users via the BO platform. The program should be running later on the platform on a regular basis.
Therefore I had a look at the example code on the Internet for sending a report to a user per email.
I reused that code and changed it in a way that the first WebI report that is found on the platform is used to send the email.
The report itself is not attached since it is just needed to send the email.
Please see the attached file for the code (for uploading reasons, I saved it in the .txt format and replaced the used email address with an imaginary one).
If I run the jar or the code locally in my Eclipse environment, the mail is sent successfully.
However running the code on the BO platform results in an SDKException:
From the given error message I concluded that a value in the IInfoObjects object (used as argument for the infoStore.sendTo method) was null and therefore invalid. Comparing the values of the objects created from local execution and execution on the platform I didn't find any differences.
Considering that the PluginMgr was involved, I thought that perhaps the IDestinationPlugin I used contained the problem. But having a look at it, I didn't find an issue.
So at the moment I am stuck with this not very meaningful error message and I really don't know what I can change in order to make my code work on the platform.
What is puzzling me is that the jar runs perfectly well if I execute it locally on my computer.
I would be really glad if you specialists had an idea what I can do in order to resolve this issue.
BR and thanks,
Agnetha-Kristin Kraus replied
I found a workaround:
Instead of using the infoStore.sendTo() method, I'm using infoStore.schedule() instead.
I created an empty dummy report on our platform and set the limit of instances to 1 (because there is no need for a scheduling history of this report).
In my program, I'm scheduling this empty dummy report now once in order to send an e-mail to a user's e-mail address.
It is not as elegant as it would have been using the sendTo() method, but this works perfectly fine for us. I grouped my application and the report together in a folder in order to reduce the risk of the dummy report being deleted.