Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Authorization timeout
 Post subject: Authorization timeout Post rating: 0   Post Posted: Mon 22 Mar, 2010, 09:37 

User rating: 0
Joined: Thu 17 Dec, 2009, 16:39
Posts: 5
These days I am troubled by network problems.
When the program is running, it always failed to connect and reconnect to the server.
This has happened frequently since last week before which everything went smooth,no matter running strategy in JForex platform straight or in custom software applications with Jforex API.

Here is the information when it happened:
2010-03-22 12:10:49.437 WARN Main - Disconnected
2010-03-22 12:10:59.515 INFO q - Authorization timeout
2010-03-22 12:11:00.609 WARN Main - Disconnected
2010-03-22 12:11:10.687 INFO q - Authorization timeout
2010-03-22 12:11:11.781 WARN Main - Disconnected
2010-03-22 12:11:21.859 INFO q - Authorization timeout
2010-03-22 12:11:22.953 WARN Main - Disconnected
2010-03-22 12:11:52.953 INFO Main - Disconnected
2010-03-22 12:12:17.093 ERROR Main - Failed to connect Dukascopy servers
2010-03-22 12:12:17.187 INFO q - Authorization timeout

There were 3 attempts to reconnect to the Dukascopy trade servers using "client.reconnect()".
After that we tried to make a new connect, however as you see it failed either.
"2010-03-22 12:12:17.187" is the time in GMT+05:00.
my account id is fumin11.

Here is the information before "disconnected":
2010-03-22 12:10:25.796 ERROR n - Client disconnected, secondary connection ping failed
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"1","type":"hb"}
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.rY(Unknown Source)
at com.dukascopy.transport.client.n.f(Unknown Source)
at com.dukascopy.transport.client.f.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2010-03-22 12:10:48.375 ERROR q - Exception caught
javax.net.ssl.SSLHandshakeException: SSL handshake failed.
at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:416)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: Received close_notify during handshake
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)
at javax.net.ssl.SSLEngine.unwrap(Unknown Source)
at org.apache.mina.filter.support.SSLHandler.unwrap0(SSLHandler.java:657)
at org.apache.mina.filter.support.SSLHandler.unwrapHandshake(SSLHandler.java:613)
at org.apache.mina.filter.support.SSLHandler.handshake(SSLHandler.java:493)
at org.apache.mina.filter.support.SSLHandler.messageReceived(SSLHandler.java:306)
at org.apache.mina.filter.SSLFilter.messageReceived(SSLFilter.java:392)
... 8 more

Why it happened and how to avoid it?
Thanks advance.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Tue 23 Mar, 2010, 03:37 

User rating: 0
Joined: Thu 17 Dec, 2009, 16:39
Posts: 5
Just now the messages below occurred right after the connection:

2010-03-23 07:09:20.468 INFO Main - Connecting...
2010-03-23 07:09:40.453 INFO Main - Subscribing instruments..
2010-03-23 07:09:40.453 INFO Main - Starting strategy
Starting strategy: mybar.MyOnBar

2010-03-23 07:09:55.796 INFO q - Authorization timeout
2010-03-23 07:09:56.890 WARN s - Disconnected from data feed server, reason - AUTHORIZATION_TIMEOUT
2010-03-23 07:09:56.890 INFO s - Connecting to data feed server [/194.8.15.161:10443] attempt [2] ...

Waiting for your help, thanks advance.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Tue 23 Mar, 2010, 04:00 

User rating: 0
Joined: Thu 17 Dec, 2009, 16:39
Posts: 5
Could you please check the connection information about the demo account "fumin11"?
Thanks a lot.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Wed 24 Mar, 2010, 15:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
this exception is caused by connection timeout. This is a normal reaction on the interpreted network connection. At the moment, the JForex is not suitable to work without a network connection.
To avoid this, you need a stable network connection.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Thu 10 Nov, 2011, 16:13 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
API Support wrote:
Hello,
this exception is caused by connection timeout. This is a normal reaction on the interpreted network connection. At the moment, the JForex is not suitable to work without a network connection.
To avoid this, you need a stable network connection.


But how to catch it? At the moment I'm trying to find a way to run my strategy 24 hours a day. I start my strategy as external process and in case of an exception it will be automatically restarted.

If I intentionally close my internet connection I get this exception too. After that ISystemListener.onDisconnect() is called, System.exit(1) and the process can be restarted. Everything is fine.

But if this exception is thrown not by my will the process seems to hang because it is the last output I see:
Quote:
2011-11-10 18:54:20.048 ERROR n - Error send synch request
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid
":"3","type":"hb"}
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.TH(Unknown Source)
at com.dukascopy.transport.client.n.f(Unknown Source)
at com.dukascopy.transport.client.r.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2011-11-10 18:54:20.052 ERROR n - Client disconnected, secondary connection ping
failed
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid
":"3","type":"hb"}
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.a(Unknown Source)
at com.dukascopy.transport.client.n.TH(Unknown Source)
at com.dukascopy.transport.client.n.f(Unknown Source)
at com.dukascopy.transport.client.r.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


The process isn't restarted. It's not what I want if I trade on real live account.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Thu 10 Nov, 2011, 16:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
trottel wrote:
But how to catch it? At the moment I'm trying to find a way to run my strategy 24 hours a day. I start my strategy as external process and in case of an exception it will be automatically restarted.
See onDisconnect method:
https://www.dukascopy.com/wiki/index.php ... m_listener


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Fri 11 Nov, 2011, 08:11 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
API Support wrote:
trottel wrote:
But how to catch it? At the moment I'm trying to find a way to run my strategy 24 hours a day. I start my strategy as external process and in case of an exception it will be automatically restarted.
See onDisconnect method:
https://www.dukascopy.com/wiki/index.php ... m_listener


Today at 11:00 AM I have seen the following output of the program which runs my strategy (the program was still running):
2011-11-11 02:57:04.453 ERROR n - Error send synch request
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"26","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2011-11-11 02:57:04.468 ERROR n - Client disconnected, secondary connection ping failed
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"26","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2011-11-11 02:57:22.156 DEBUG c - (d-ja-gva-91-191.dukascopy.com/194.8.15.191:10443) message factory created
2011-11-11 06:54:07.599 DEBUG ScienceQueue - old tick removed from the queue [1320980025277[2011-11-11 02:53:45.277+0000] / 1.36221 / 1.36212], current time [1320980026597], diff [1320] tick waiting in queue [2]
2011-11-11 06:54:07.603 DEBUG ScienceQueue - old tick removed from the queue [1320980026706[2011-11-11 02:53:46.706+0000] / 1.36219 / 1.36211], current time [1320980027917], diff [1211] tick waiting in queue [1]
2011-11-11 06:54:07.606 DEBUG ScienceQueue - old tick removed from the queue [1320980026597[2011-11-11 02:53:46.597+0000] / 1.36221 / 1.36217], current time [1320980027917], diff [1320] tick waiting in queue [1]
2011-11-11 06:54:07.608 DEBUG ScienceQueue - old tick removed from the queue [1320980025826[2011-11-11 02:53:45.826+0000] / 1.3622 / 1.36212], current time [1320980027917], diff [2091] tick waiting in queue [1]
2011-11-11 06:54:07.657 DEBUG ScienceQueue - old tick removed from the queue [1320980029896[2011-11-11 02:53:49.896+0000] / 1.36212 / 1.36204], current time [1320980031146], diff [1250] tick waiting in queue [2]
2011-11-11 06:54:07.721 DEBUG ScienceQueue - old tick removed from the queue [1320980037046[2011-11-11 02:53:57.046+0000] / 1.36214 / 1.36205], current time [1320980038906], diff [1860] tick waiting in queue [1]
2011-11-11 06:54:07.721 DEBUG ScienceQueue - old tick removed from the queue [1320980036427[2011-11-11 02:53:56.427+0000] / 1.36211 / 1.36205], current time [1320980038906], diff [2479] tick waiting in queue [1]


Here is the code of my onDisconnect() method:
@Override
public void onDisconnect() {
   LOGGER.warn("############## Disconnected ##############");
   System.exit(1);
}

Thus each time when onDisconnect() is called the message "############## Disconnected ##############" will be printed.
So the question is: Is my strategy still running and able to trade?


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Fri 11 Nov, 2011, 18:41 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
Checked the output in the evening again and recognized that some orders were filled since exception has been occured. So it seems to trade anyway. But however the exception is a little annoying because each time after I have seen such output:

2011-11-10 18:52:29.376 ERROR com.dukascopy.transport.client.n - Error send synch request
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"1","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2011-11-10 18:52:29.380 ERROR com.dukascopy.transport.client.n - Client disconnected, secondary connection ping failed
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"1","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2011-11-10 18:52:39.386 ERROR com.dukascopy.transport.client.n - Error send synch request
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"2","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TI(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2011-11-10 18:52:39.387 ERROR com.dukascopy.transport.client.n - Client disconnected, primary connection ping failed
java.util.concurrent.TimeoutException: No response from server. Request: {"reqid":"2","type":"hb"}
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.a(Unknown Source)
   at com.dukascopy.transport.client.n.TI(Unknown Source)
   at com.dukascopy.transport.client.n.TH(Unknown Source)
   at com.dukascopy.transport.client.n.f(Unknown Source)
   at com.dukascopy.transport.client.r.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


onDisconnect() was called. Has it something to do with secondary and primary connections? Can I be sure that onDisconnect() will be called each time when no trading is possible?


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Mon 14 Nov, 2011, 09:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
trottel wrote:
Can I be sure that onDisconnect() will be called each time when no trading is possible?
Yes, it gets called whenever there are connectivity problems or system disconnects.
trottel wrote:
Has it something to do with secondary and primary connections?
See the first post of "API Support" for this topic.


 
 Post subject: Re: Authorization timeout Post rating: 0   Post Posted: Wed 16 Nov, 2011, 19:09 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
API Support wrote:
trottel wrote:
Can I be sure that onDisconnect() will be called each time when no trading is possible?
Yes, it gets called whenever there are connectivity problems or system disconnects.
trottel wrote:
Has it something to do with secondary and primary connections?
See the first post of "API Support" for this topic.


Thanks


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com