Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
Remote run: sendEmail(...) http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=88&t=51390 |
Page 1 of 2 |
Author: | Moggy [ Thu 24 Apr, 2014, 08:41 ] |
Post subject: | how to grant socket permission in remote mode? |
Dears: i have write a strategy to send mail in remote mode,but failed,the log is: Exception:java.security.AccessControlException: access denied ("java.net.SocketPermission" "smtp.163.com" "resolve") i add the following grant clause to java.policy,but the problem still exist. permission java.net.SocketPermission "*", "accept,connect,resolve"; anybody can help me? thanks a lot btw: local mode is OK |
Author: | hebasto [ Thu 24 Apr, 2014, 09:04 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
Forum: strategy on remote server, how to send email? |
Author: | Moggy [ Fri 25 Apr, 2014, 04:08 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
hebasto wrote: thanks for your kindly reply. i have read this topic before. quotation: @Library("mail-1.4.jar") jar location: mail-1.4.jar is located in /home/moggy/JForex/Strategies/files/ (my OS is Ubuntu) add the permission in both files: /etc/java-6-sun/security/java.policy /etc/java-6-openjdk/security/java.policy // Allow connection to mail server using SMTP sendMail Function: public boolean sendMail(String from, String to, String subj, String text) |
Author: | hebasto [ Fri 25 Apr, 2014, 07:48 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
I've searched through this forum and find out (Sending an email) that one should use RequiresFullAccess annotation to be allowed send email. BUT RequiresFullAccess annotation is not allowed in remote strategy code (Remote Run) In my opinion remote strategy environment is not suitable for such tasks as sending email. And it is not reliable as well (Delay in data feed on Remote Run). |
Author: | Moggy [ Fri 25 Apr, 2014, 09:50 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
hebasto wrote: I've searched through this forum and find out (Sending an email) that one should use RequiresFullAccess annotation to be allowed send email. BUT RequiresFullAccess annotation is not allowed in remote strategy code (Remote Run) In my opinion remote strategy environment is not suitable for such tasks as sending email. And it is not reliable as well (Delay in data feed on Remote Run). Yeah,exactly,maybe it's commercial but not technical reason. |
Author: | API Support [ Mon 28 Apr, 2014, 09:12 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
We plan to add mail sending functionality to API in order to facilitate the mail sending routine and enable its usage in the local run. Meanwhile consider broadcasting your message to a local strategy, which thereafter would send the e-mail: https://www.dukascopy.com/wiki/#Broadcast_message |
Author: | whiletrue [ Wed 11 Jun, 2014, 14:45 ] |
Post subject: | Remote run: log and alert |
Hi, When doing Remote run on a strategy, what is the preferred way to: - log (i.e., log to file or console so that I can look and/or retreive the log at any time in the future)? Also, are there any limitations on the log size? - alert myself (e.g., sending myself an e-mail) when something goes wrong? Thanks. Regards, Henrik |
Author: | hebasto [ Wed 11 Jun, 2014, 19:35 ] |
Post subject: | Re: Remote run: log and alert |
whiletrue wrote: - log (i.e., log to file or console so that I can look and/or retreive the log at any time in the future)? https://www.dukascopy.com/wiki/#Remote_RunWiki wrote: 3. There is no work with files (i.e., java.io.File). Wiki wrote: 8. IConsole.get*().println() should be called no more often than once per 1ms. Otherwise only the last statement will get logged. Wiki wrote: 7. Strategy logs don't get written in the platform, rather they can be accessed by selecting in the plaform Portfolio -> Strategy Log. Be aware that:Dukascopy does not guarantee you can retrieve the log - Remote Strategy Log is broken Dukascopy does not guarantee the log will be complete - Remote Strategy Log suppresses output whiletrue wrote: Also, are there any limitations on the log size? Yes, there are. But Dukascopy keep silence about this - Remote Strategy Log size limitswhiletrue wrote: - alert myself (e.g., sending myself an e-mail) when something goes wrong? Send e-mail & JFUtils.sendEmailBroadcast message & IEngine.broadcast Notification by SMS or email |
Author: | whiletrue [ Thu 12 Jun, 2014, 11:39 ] |
Post subject: | Re: Remote run: log and alert |
Hi again, Thanks hebasto. Does Dukascopy provide a smtp server, or do I have to provide one myself? If so, can I use my gmail stmp server? If so, how? Regards, Henrik |
Author: | API Support [ Thu 12 Jun, 2014, 11:53 ] |
Post subject: | Re: Remote run: log and alert |
whiletrue wrote: Does Dukascopy provide a smtp server, or do I have to provide one myself? The latter.whiletrue wrote: If so, can I use my gmail stmp server? If so, how? https://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm
|
Author: | Moggy [ Fri 13 Jun, 2014, 04:18 ] |
Post subject: | Re: how to grant socket permission in remote mode? |
the new JDK have add an interface JFUtils.sendEmail to send mail in remote mode. https://www.dukascopy.com/wiki/#Send_e-mail it seems that jdk use mail-1.4.jar too~ Now the problem is,when i call myutils.sendMail(smtpServer, from, to, subj, text); it shows exception: 06:19:11 Exception:com.dukascopy.api.JFException: com.sun.mail.smtp.SMTPSendFailedException: 553 You are not authorized to send mail, ... how to pass the password to JFUtils to authenticate the from mail account? |
Author: | whiletrue [ Mon 16 Jun, 2014, 18:00 ] |
Post subject: | Remote run: sendEmail(...) |
Hi, How to use JFUtils.sendEmail(...) on Remote run? Should I specify the smtpServer string parameter as: "<my_email>@gmail.com:<my_password>@smtp.gmail.com:465" ? Thanks in advance. Regards, Henrik PS. It would be really nice if Dukascopy could provide a smtp server... =) |
Author: | API Support [ Wed 18 Jun, 2014, 08:18 ] |
Post subject: | Re: Remote run: sendEmail(...) |
The functionality is not working on Remote at the moment, it will be fixed as soon as possible. |
Author: | whiletrue [ Wed 18 Jun, 2014, 11:42 ] |
Post subject: | Re: Remote run: sendEmail(...) |
Ok, I see. Please provide a complete example of how to use the JFUtils.sendEmail(...) on Remote run once it works again. Thanks. Regards, Henrik |
Author: | API Support [ Fri 27 Jun, 2014, 08:36 ] |
Post subject: | Re: Remote run: sendEmail(...) |
Fixed with JForex-API 2.9.12. |
Author: | whiletrue [ Mon 30 Jun, 2014, 14:40 ] |
Post subject: | Re: Remote run: sendEmail(...) |
Great. But how to configure the smtp server when running remotely? Thanks. /Henrik |
Author: | Moggy [ Fri 04 Jul, 2014, 02:17 ] |
Post subject: | Re: Remote run: sendEmail(...) |
API Support wrote: Fixed with JForex-API 2.9.12. 2.9.12 seems to be unavailable from the website now. |
Author: | API Support [ Fri 11 Jul, 2014, 15:43 ] |
Post subject: | Re: Remote run: sendEmail(...) |
Moggy wrote: 2.9.12 seems to be unavailable from the website now. It has not been released yet.whiletrue wrote: But how to configure the smtp server when running remotely? We are working on this, but it will not be available with 2.9.12.
|
Author: | whiletrue [ Tue 28 Oct, 2014, 12:34 ] |
Post subject: | Re: Remote run: sendEmail(...) |
Hi again, Any progress regarding this matter? Please provide complete code example. Thanks. Kind Regards, Henrik |
Author: | API Support [ Tue 28 Oct, 2014, 13:32 ] |
Post subject: | Re: Remote run: sendEmail(...) |
See JavaDoc: https://www.dukascopy.com/client/javadoc/com/dukascopy/api/JFUtils.html#sendMail(java.lang.String,%20java.lang.String,%20java.lang.String) This should work both local and remote. You don't need to provide smtp server or configure it. |
Page 1 of 2 |