I tried with IBGateway. The behavious is the same as with TWS. If I start IBGateway and login before launching LEAN, the connection is established. If I start just LEAN launcher, nothin happens, it does not start IBGateway. The log below, looks the same. Is it expected behavious? If no, what can be the reason? JTS folder in config is correct.
20191030 10:58:50.817 Trace:: Config.GetValue(): debug-mode - Using default value: False
20191030 10:58:50.826 Trace:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default value:
20191030 10:58:50.828 Trace:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default value: C:\Work\Advisors\QuantConnect\Lean\Launcher\bin\Debug\
20191030 10:58:52.901 Trace:: Config.Get(): Configuration key not found. Key: data-directory - Using default value: ../../../Data/
20191030 10:58:52.903 Trace:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20191030 10:58:52.904 Trace:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: ../../../Data/
20191030 10:58:52.904 Trace:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.4.0.0 Mode: DEBUG (64bit)
20191030 10:58:52.904 Trace:: Engine.Main(): Started 10:58 AM
20191030 10:58:52.907 Trace:: Config.GetValue(): job-project-id - Using default value: 0
20191030 10:58:52.908 Trace:: Config.Get(): Configuration key not found. Key: algorithm-path-python - Using default value: ../../../Algorithm.Python/
20191030 10:58:52.909 Trace:: Config.GetValue(): regression-update-statistics - Using default value: False
20191030 10:58:52.910 Trace:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value: LocalLeanManager
20191030 10:58:52.976 Trace:: Config.Get(): Configuration key not found. Key: cloud-api-url - Using default value: https://www.quantconnect.com/api/v2/
20191030 10:58:52.997 Trace:: JobQueue.NextJob(): Selected ../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py
20191030 10:58:55.132 Trace:: Python for .NET Assembly: Python.Runtime, Version=1.0.5.26, Culture=neutral, PublicKeyToken=null
20191030 10:58:55.749 Trace:: Python for .NET Assembly: nPython, Version=1.0.5.26, Culture=neutral, PublicKeyToken=null
20191030 10:58:59.628 Trace:: Config.GetValue(): ignore-version-checks - Using default value: False
20191030 10:58:59.630 Trace:: Config.GetValue(): algorithm-manager-time-loop-maximum - Using default value: 20
20191030 10:58:59.654 ERROR:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20191030 10:59:00.028 Trace:: PythonInitializer.Initialize(): start...
PythonEngine.Initialize(): Runtime.Initialize()...
Runtime.Initialize(): Py_Initialize...
Runtime.Initialize(): PyEval_InitThreads...
Runtime.Initialize(): Initialize types...
Runtime.Initialize(): Initialize types end.
Runtime.Initialize(): AssemblyManager.Initialize()...
Runtime.Initialize(): AssemblyManager.UpdatePath()...
PythonEngine.Initialize(): register atexit callback...
PythonEngine.Initialize(): GetCLRModule()...
PythonEngine.Initialize(): clr GetManifestResourceStream...
20191030 10:59:05.386 Trace:: PythonInitializer.Initialize(): ended
20191030 10:59:05.403 Trace:: AlgorithmPythonWrapper(): Python version 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]: Importing python module BasicTemplateFrameworkAlgorithm
20191030 10:59:18.227 Trace:: AlgorithmPythonWrapper(): Creating IAlgorithm instance.
20191030 10:59:23.722 Trace:: Config.GetValue(): mute-python-library-logging - Using default value: True
20191030 10:59:23.771 Trace:: Config.Get(): Configuration key not found. Key: ib-version - Using default value: 974
20191030 10:59:23.792 Trace:: InteractiveBrokersBrokerage.InteractiveBrokersBrokerage(): Starting IB Automater...
20191030 10:59:24.023 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): StartIBGateway(): starting IBGateway
20191030 10:59:24.085 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): Exception in thread "main" java.lang.NoClassDefFoundError: ibgateway/GWClient
20191030 10:59:24.085 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at ibautomater.IBAutomater.startIBGateway(IBAutomater.java:69)
20191030 10:59:24.087 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at ibautomater.IBAutomater.main(IBAutomater.java:55)
20191030 10:59:24.089 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): Caused by: java.lang.ClassNotFoundException: ibgateway.GWClient
20191030 10:59:24.089 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at java.net.URLClassLoader.findClass(Unknown Source)
20191030 10:59:24.089 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at java.lang.ClassLoader.loadClass(Unknown Source)
20191030 10:59:24.090 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
20191030 10:59:24.090 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): at java.lang.ClassLoader.loadClass(Unknown Source)
20191030 10:59:24.091 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterErrorDataReceived(): ... 2 more
20191030 10:59:25.214 Trace:: InteractiveBrokersBrokerage.OnIbAutomaterExited(): Exit code: 1
20191030 11:00:23.803 Trace:: InteractiveBrokersBrokerage.InteractiveBrokersBrokerage(): IB Automater initialization timeout.
20191030 11:00:23.803 Trace:: InteractiveBrokersBrokerage.InteractiveBrokersBrokerage(): IB Automater initialized.
20191030 11:00:23.805 Trace:: InteractiveBrokersBrokerage.InteractiveBrokersBrokerage(): Host: 127.0.0.1, Port: 4002, Account: DU1690449, AgentDescription: Individual
20191030 11:00:23.811 Trace:: InteractiveBrokersBrokerage.ResetHandler(): thread started.
20191030 11:00:23.834 Trace:: LiveTradingDataFeed.GetDataQueueHandler(): will use QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage
20191030 11:00:23.839 Trace:: BaseDataExchange(CustomDataExchange) Starting...
20191030 11:00:23.839 Trace:: BaseDataExchange(DataQueueExchange) Starting...
20191030 11:00:23.848 Trace:: InteractiveBrokersBrokerage.Connect(): Attempting to connect (1/5) ...
20191030 11:00:28.386 Trace:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:00:28.391 Trace:: Brokerage.OnMessage(): Information - Code: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:00:28.401 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread started: #23
20191030 11:00:28.401 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread ended: #23
20191030 11:01:28.397 Trace:: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
20191030 11:01:29.398 Trace:: InteractiveBrokersBrokerage.Connect(): Attempting to connect (2/5) ...
20191030 11:01:31.404 Trace:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:01:31.406 Trace:: Brokerage.OnMessage(): Information - Code: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:01:31.415 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread started: #10
20191030 11:01:31.415 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread ended: #10
20191030 11:02:31.413 Trace:: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
20191030 11:02:32.414 Trace:: InteractiveBrokersBrokerage.Connect(): Attempting to connect (3/5) ...
20191030 11:02:34.417 Trace:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:02:34.419 Trace:: Brokerage.OnMessage(): Information - Code: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:02:34.428 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread started: #8
20191030 11:02:34.428 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread ended: #8
20191030 11:03:34.426 Trace:: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
20191030 11:03:35.427 Trace:: InteractiveBrokersBrokerage.Connect(): Attempting to connect (4/5) ...
20191030 11:03:37.432 Trace:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:03:37.433 Trace:: Brokerage.OnMessage(): Information - Code: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:03:37.442 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread started: #7
20191030 11:03:37.443 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread ended: #7
20191030 11:04:37.440 Trace:: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
20191030 11:04:38.441 Trace:: InteractiveBrokersBrokerage.Connect(): Attempting to connect (5/5) ...
20191030 11:04:40.447 Trace:: InteractiveBrokersBrokerage.HandleError(): RequestId: -1 ErrorCode: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:04:40.451 Trace:: Brokerage.OnMessage(): Information - Code: -1 - System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002. at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port). at IBApi.EClientSocket.createClientStream(String host, Int32 port). at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
20191030 11:04:40.470 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread started: #6
20191030 11:04:40.470 Trace:: InteractiveBrokersBrokerage.Connect(): IB message processing thread ended: #6
20191030 11:05:40.468 Trace:: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
20191030 11:05:40.514 ERROR:: InteractiveBrokersBrokerage.Connect(): System.TimeoutException: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
at QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage.Connect() in C:\Work\Advisors\QuantConnect\Lean\Brokerages\InteractiveBrokers\InteractiveBrokersBrokerage.cs:line 680
20191030 11:05:40.523 ERROR:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20191030 11:05:40.538 ERROR:: Engine.Run(): System.TimeoutException: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
at QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage.Connect() in C:\Work\Advisors\QuantConnect\Lean\Brokerages\InteractiveBrokers\InteractiveBrokersBrokerage.cs:line 755
at QuantConnect.Lean.Engine.HistoricalData.BrokerageHistoryProvider.Initialize(HistoryProviderInitializeParameters parameters) in C:\Work\Advisors\QuantConnect\Lean\Engine\HistoricalData\BrokerageHistoryProvider.cs:line 53
at QuantConnect.Lean.Engine.Engine.Run(AlgorithmNodePacket job, AlgorithmManager manager, String assemblyPath) in C:\Work\Advisors\QuantConnect\Lean\Engine\Engine.cs:line 184
20191030 11:05:40.543 Trace:: JOB HANDLERS:
20191030 11:05:40.543 Trace:: DataFeed: QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed
20191030 11:05:40.544 Trace:: Setup: QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler
20191030 11:05:40.544 Trace:: RealTime: QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler
20191030 11:05:40.545 Trace:: Results: QuantConnect.Lean.Engine.Results.LiveTradingResultHandler
20191030 11:05:40.545 Trace:: Transactions: QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler
20191030 11:05:40.545 Trace:: Alpha: QuantConnect.Lean.Engine.Alphas.DefaultAlphaHandler
20191030 11:05:40.546 Trace:: Brokerage: QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage
20191030 11:05:40.565 Trace:: Waiting for threads to exit...
20191030 11:05:40.632 Trace:: Config.GetValue(): send-via-api - Using default value: False
20191030 11:05:40.636 ERROR:: Algorithm.Initialize() Error: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds. Stack Trace: System.TimeoutException: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
at QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage.Connect() in C:\Work\Advisors\QuantConnect\Lean\Brokerages\InteractiveBrokers\InteractiveBrokersBrokerage.cs:line 755
at QuantConnect.Lean.Engine.HistoricalData.BrokerageHistoryProvider.Initialize(HistoryProviderInitializeParameters parameters) in C:\Work\Advisors\QuantConnect\Lean\Engine\HistoricalData\BrokerageHistoryProvider.cs:line 53
at QuantConnect.Lean.Engine.Engine.Run(AlgorithmNodePacket job, AlgorithmManager manager, String assemblyPath) in C:\Work\Advisors\QuantConnect\Lean\Engine\Engine.cs:line 184
System.TimeoutException: InteractiveBrokersBrokerage.Connect(): Operation took longer than 15 seconds.
at QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage.Connect() in C:\Work\Advisors\QuantConnect\Lean\Brokerages\InteractiveBrokers\InteractiveBrokersBrokerage.cs:line 755
at QuantConnect.Lean.Engine.HistoricalData.BrokerageHistoryProvider.Initialize(HistoryProviderInitializeParameters parameters) in C:\Work\Advisors\QuantConnect\Lean\Engine\HistoricalData\BrokerageHistoryProvider.cs:line 53
at QuantConnect.Lean.Engine.Engine.Run(AlgorithmNodePacket job, AlgorithmManager manager, String assemblyPath) in C:\Work\Advisors\QuantConnect\Lean\Engine\Engine.cs:line 184
20191030 11:05:40.649 ERROR:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20191030 11:05:40.674 Trace:: Waiting for threads to exit...
20191030 11:05:40.752 Trace:: LiveTradingResultHandler.Run(): Ending Thread...
20191030 11:05:40.782 Trace:: Waiting for threads to exit...
20191030 11:06:13.118 Trace:: Engine.Run(): Disconnecting from brokerage...
20191030 11:06:13.118 Trace:: InteractiveBrokersBrokerage.Dispose(): Disposing of IB resources.
20191030 11:06:13.396 Trace:: Engine.Run(): Disposing of setup handler...
20191030 11:06:13.396 Trace:: InteractiveBrokersBrokerage.ResetHandler(): thread ended.
20191030 11:06:13.397 Trace:: Engine.Main(): Analysis Completed and Results Posted.
20191030 11:06:13.401 Trace:: LiveTradingDataFeed.Exit(): Start. Setting cancellation token...
20191030 11:06:13.401 Trace:: BaseDataExchange(DataQueueExchange) Stopping...
20191030 11:06:13.402 Trace:: LiveTradingDataFeed.GetNextTicksEnumerator(): Exiting enumerator thread...
20191030 11:06:13.402 Trace:: BaseDataExchange(CustomDataExchange) Stopping...
20191030 11:06:13.402 Trace:: LiveTradingDataFeed.Exit(): Exit Finished.
20191030 11:06:13.403 Trace:: BaseDataExchange(DataQueueExchange).ConsumeQueue(): Cancellation requested. Exiting...
Engine.Main(): Analysis Complete. Press any key to continue.
20191030 11:06:13.406 Trace:: BaseDataExchange(CustomDataExchange).ConsumeQueue(): Cancellation requested. Exiting...