Hello,
I have just experienced the above exception for the second time in a standalone JForex API
application (2.6.46) when submitting order. I am aware of threading issues:
https://www.dukascopy.com/wiki/index.php?title=ThreadingThe strange thing is that I do not send orders from an Event
Dispatch thread or any other thread. The strategy runs automatically
in a thread provided by ClientFactory.getDefaultInstance().
I did not catch the exception, it stopped the strategy (onStop was invoked). But the other
strange thing is that the strategy kept on executing, receiving messages, bars etc. as if nothing happened. The orders were received and filled. If onStop is invoked I would expect that it is shut down. I have my client code that depends on the onStop method. In particular I can turn the strategy on from my GUI and have two instances run at the same time...
The stack trace:
com.dukascopy.api.JFException: Incorrect thread
at com.dukascopy.api.impl.connect.JForexEngineImpl.submitOrder(JForexEngineImpl.java:117)
at com.dukascopy.api.impl.connect.JForexEngineImpl.submitOrder(JForexEngineImpl.java:296)
at com.dukascopy.api.impl.connect.JForexEngineImpl.submitOrder(JForexEngineImpl.java:300)
at com.dukascopy.api.impl.connect.JForexEngineImpl.submitOrder(JForexEngineImpl.java:304)
(...) client code
at com.dukascopy.api.impl.execution.TaskTick.call(TaskTick.java:62)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.runTask(ScienceThreadPoolExecutor.java:904)
at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.run(ScienceThreadPoolExecutor.java:926)
at java.lang.Thread.run(Thread.java:662)
Today it happened at 2011-12-02 13:26:56.558 GMT if it's of any use.
Regards,
Marcin Bablok