IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
974 stars 174 forks source link

UI Freezed after Login #233

Closed acrive82 closed 8 months ago

acrive82 commented 8 months ago

image

I'm currently dealing with an issue. In brief, when I attempt to launch the TWS (not the gateway, the gateway's UI functions perfectly), my UI becomes unresponsive after logging in. This behavior is evident from the clock.

This is the output:


------------------------------------------------------------
java.runtime.name = OpenJDK Runtime Environment
sun.boot.library.path = C:\xxxxx\.jdks\corretto-1.8.0_392\jre\bin
java.vm.version = 25.392-b08
java.vm.vendor = Amazon.com Inc.
java.vendor.url = https://aws.amazon.com/corretto/
path.separator = ;
java.vm.name = OpenJDK 64-Bit Server VM
file.encoding.pkg = sun.io
user.country = GB
user.script = 
sun.java.launcher = SUN_STANDARD
sun.os.patch.level = 
java.vm.specification.name = Java Virtual Machine Specification
user.dir = C:\Work\xxx\ibc
vertx.id = b437f5ee-122f-4c36-82bb-7ef0009054a2-redeploy
java.runtime.version = 1.8.0_392-b08
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Users\xxx\.jdks\corretto-1.8.0_392\jre\lib\endorsed
os.arch = amd64
java.io.tmpdir = C:\Users\xxxx\AppData\Local\Temp\
line.separator = 

java.vm.specification.vendor = Oracle Corporation
user.variant = 
os.name = Windows 10
sun.jnu.encoding = Cp1252
java.library.path = C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Tools\node-v18.17.1-win-x64;C:\Users\xxxx\AppData\Local\Programs\Python\Launcher\;C:\Users\xxxx\AppData\Local\Microsoft\WindowsApps;C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\xxxx\AppData\Local\Programs\Git\cmd;.
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
os.version = 10.0
user.home = C:\Users\xxxx
user.timezone = Europe/London
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.8
java.class.path = C:\Work\xxxx\ibc\build\classes\java\main;C:\Work\xxxx\ibc\build\resources\main;C:\Work\xxxx\ibc\lib\IBC.jar;C:\Jts\1025\jars\batik-all-1.16.jar;C:\Jts\1025\jars\commons-io-2.11.0.jar;C:\Jts\1025\jars\fop-2.8.jar;C:\Jts\1025\jars\jackson-core-2.12.3.jar;C:\Jts\1025\jars\jts4launch-1025.jar;C:\Jts\1025\jars\jxbrowser-7.29.jar;C:\Jts\1025\jars\jxbrowser-swing-7.29.jar;C:\Jts\1025\jars\jxbrowser-win64-7.29.jar;C:\Jts\1025\jars\locales.jar;C:\Jts\1025\jars\log4j-api-2.17.1.jar;C:\Jts\1025\jars\log4j-core-2.17.1.jar;C:\Jts\1025\jars\total-2023.jar;C:\Jts\1025\jars\twslaunch-1025.jar;C:\Jts\1025\jars\twslaunch-install4j-1.12.jar;C:\Jts\1025\jars\xmlgraphics-commons-2.8.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-health-check\4.4.6\84db591ffd291ecd041cea72484161338aa3cb10\vertx-health-check-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-web-openapi\4.4.6\ab45c7380ba61d7574bd492846778dbffd549d14\vertx-web-openapi-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-web-validation\4.4.6\f4059601d6c90023352e8b15a7b35fb828693632\vertx-web-validation-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-web\4.4.6\4ac621bf0d84d45d178443046ee31181f093b0f5\vertx-web-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-micrometer-metrics\4.4.6\96c2c3b65a103bc12ff43336744a8c839bc322d3\vertx-micrometer-metrics-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-auth-common\4.4.6\20216dee7048926a5d560134628a7bc656820eab\vertx-auth-common-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-web-common\4.4.6\642ab8cccdf721f37e6b8ba83f397b0080c9adc3\vertx-web-common-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-bridge-common\4.4.6\4539cad3dd815e330636cfc8249d57434b31817c\vertx-bridge-common-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-json-schema\4.4.6\1aa90e18b8377d8f36e6797c007b0ff944b43db0\vertx-json-schema-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-core\4.4.6\69424480793441d54d331566e8946d653a18b316\vertx-core-4.4.6.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-handler-proxy\4.1.100.Final\af3cf676eed30184215426ecf0f0dde15555ea9c\netty-handler-proxy-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec-http2\4.1.100.Final\cbf1a430ea44dbdedbcde16b185cbb95f28d72c7\netty-codec-http2-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec-http\4.1.100.Final\992623e7d8f2d96e41faf1687bb963f5433e3517\netty-codec-http-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-resolver-dns\4.1.100.Final\62dbdf5f25eda75ea8456be1ed72b3fcb0d18774\netty-resolver-dns-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-handler\4.1.100.Final\4c0acdb8bb73647ebb3847ac2d503d53d72c02b4\netty-handler-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-transport-native-unix-common\4.1.100.Final\648ff5571022dbfa6789122e3872477bbf67fa7b\netty-transport-native-unix-common-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec-socks\4.1.100.Final\a9fbf4d64b08abed542eefd5f7aed4807edca56f\netty-codec-socks-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec-dns\4.1.100.Final\663b1b7bf3ff0f12fde4df20c72d9e94584ebffa\netty-codec-dns-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec\4.1.100.Final\9c3c71e7cf3b8ce3bfc9fa52a524b9ca7ddf259c\netty-codec-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-transport\4.1.100.Final\6620fbfb47667a5eb6050e35c7b4c88000bcd77f\netty-transport-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-buffer\4.1.100.Final\39b05d2d4027971bf99111a9be1d7035a116bb55\netty-buffer-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-resolver\4.1.100.Final\fe62f9ccd41b8660d07639dbbab8ae1edd6f2720\netty-resolver-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.netty\netty-common\4.1.100.Final\847f942381145de23f21c836d05b0677474271d3\netty-common-4.1.100.Final.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.15.0\12f334a1dc9c6d2854c43ae314024dde8b3ad572\jackson-core-2.15.0.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\2.0\3aab2116756442bf0d4cd1c089b24d34c3baa253\snakeyaml-2.0.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-core\1.11.5\d87189697cd35a09bcd8666c56b58ba39e9a5a3\micrometer-core-1.11.5.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\org.hdrhistogram\HdrHistogram\2.1.12\6eb7552156e0d517ae80cc2247be1427c8d90452\HdrHistogram-2.1.12.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.11.5\803f341121416365d1c438fe2a7290b146fadc92\micrometer-observation-1.11.5.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.11.5\3e708f737ba2674823201a836b5858482b183902\micrometer-commons-1.11.5.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\org.latencyutils\LatencyUtils\2.0.3\769c0b82cb2421c8256300e907298a9410a2a3d3\LatencyUtils-2.0.3.jar;C:\Users\xxxx\.gradle\caches\modules-2\files-2.1\ch.randelshofer\fastdoubleparser\0.8.0\85c25540369921659556ead85e02c99ef0d24280\fastdoubleparser-0.8.0.jar
user.name = xxxx
java.vm.specification.version = 1.8
sun.java.command = io.vertx.core.Launcher run *** -Dvertx.id=b437f5ee-122f-4c36-82bb-7ef0009054a2-redeploy
java.home = C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre
sun.arch.data.model = 64
user.language = en
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode
java.version = 1.8.0_392
java.ext.dirs = C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\ext;C:\windows\Sun\Java\lib\ext
sun.boot.class.path = C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\resources.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\rt.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\sunrsasign.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\jsse.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\jce.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\charsets.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\lib\jfr.jar;C:\Users\xxxx\.jdks\corretto-1.8.0_392\jre\classes
java.vendor = Amazon.com Inc.
java.specification.maintenance.version = 5
file.separator = \
java.vendor.url.bug = https://github.com/corretto/corretto-8/issues/
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.desktop = windows
sun.cpu.isalist = amd64
------------------------------------------------------------
using MySettings settings provider
using MyLoginManager provider
2023-10-26 11:20:24:170 IBC: Using default main window manager: constructor parameter isGateway=false
using MyTradingModeManager provider
2023-10-26 11:20:24:170 IBC: Using default config dialog manager
2023-10-26 11:20:24:174 IBC: CommandServer is starting with port 7462
2023-10-26 11:20:24:265 IBC: TWS Settings directory is: C:\JTS
2023-10-26 11:20:24:266 IBC: Ensuring C:\JTS\jts.ini contains required minimal lines
2023-10-26 11:20:24:267 IBC: Found setting: [Logon]/s3store=true
2023-10-26 11:20:24:267 IBC: Found setting: [Logon]/Locale=en
2023-10-26 11:20:24:267 IBC: Found setting: [Logon]/displayedproxymsg=1
2023-10-26 11:20:24:267 IBC: Found setting: [Logon]/UseSSL=true
2023-10-26 11:20:24:267 IBC: Found setting: [IBGateway]/ApiOnly=true
2023-10-26 11:20:24:267 IBC: Confirmed C:\JTS\jts.ini contains required minimal lines
2023-10-26 11:20:24:267 IBC: Starting TWS
2023-10-26 11:20:24:267 IBC: Starting session: will exit if login dialog is not displayed within 60 seconds
2023-10-26 11:20:24:656 IBC: CommandServer listening on addresses: 127.0.0.1,0:0:0:0:0:0:0:1,fe80:0:0:0:e60f:38d8:6ea0:44b4%eth0,10.11.0.4,fe80:0:0:0:fe96:700e:9b4b:9454%wlan0,fe80:0:0:0:1f7e:c2d2:8b82:8c97%eth3,fe80:0:0:0:90dd:fd2e:5b2d:7e14%wlan1,fe80:0:0:0:1c0b:e4d5:2ac1:5977%eth4,fe80:0:0:0:1b5:eb2f:ea97:3135%eth6,fe80:0:0:0:a40e:d2f:5b8f:e0c4%eth8,fe80:0:0:0:a5eb:a580:a2d1:aab7%wlan2,172.27.192.1,fe80:0:0:0:da50:75a1:4abf:bede%eth36; port: 7462
2023-10-26 11:20:24:656 IBC: CommandServer started and is ready to accept commands
2023-10-26 11:20:28:060 IBC: Detected frame entitled: Login; event=Activated
2023-10-26 11:20:28:070 IBC: Detected frame entitled: Login; event=Focused
2023-10-26 11:20:28:070 IBC: Detected frame entitled: Login; event=Opened
2023-10-26 11:20:28:071 IBC: Login dialog WINDOW_OPENED: LoginState is LOGGED_OUT
2023-10-26 11:20:28:071 IBC: Setting Trading mode = paper
2023-10-26 11:20:28:145 IBC: Setting user name
2023-10-26 11:20:28:147 IBC: Setting password
2023-10-26 11:20:28:147 IBC: Login attempt: 1
2023-10-26 11:20:28:167 IBC: Click button: Paper Log In
2023-10-26 11:20:28:284 IBC: Button now disabled: Paper Log In
LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
2023-10-26 11:20:42:076 IBC: Detected frame entitled: ; event=Closed
2023-10-26 11:20:42:337 IBC: Detected frame entitled: Login; event=Lost focus
2023-10-26 11:20:42:337 IBC: Detected frame entitled: Login; event=Deactivated
2023-10-26 11:20:42:337 IBC: Detected frame entitled: DU666666 Interactive Brokers (Simulated Trading); event=Activated
2023-10-26 11:20:42:340 IBC: Detected frame entitled: DU666666 Interactive Brokers (Simulated Trading); event=Focused
2023-10-26 11:20:42:340 IBC: Detected frame entitled: DU666666 Interactive Brokers (Simulated Trading); event=Opened
2023-10-26 11:20:42:341 IBC: Found TWS main window
2023-10-26 11:20:42:341 IBC: Login has completed
2023-10-26 11:20:43:563 IBC: Detected frame entitled: Login; event=Closed
2023-10-26 11:20:43:563 IBC: Detected frame entitled: Login; event=Closed
2023-10-26 11:20:44:369 IBC: Detected dialog entitled: Pending Tasks; event=Closed

I'm following the sample and I removed the custom clock.

rlktradewright commented 8 months ago

The only suggestion I can make is to NOT use OpenJDK. I've never managed to make TWS work properly with OpenJDK (though I have to admit it's a long time since I tried).

TWS works best with the 'private' Oracle JDK included in the TWS install: this is the Java version that IBKR use to implement and test TWS, so it makes sense to use that.. Assuming you're using the RunIBCLoader.bat script included in the sample, just leave the /JavaPath argument blank.

My understanding is that the reason TWS doesn't work properly wirh OpenJDK 8 is that the TWS login dialog uses JavaFx, and the OpenJDK 8 implementation doesn't include a full implementation of JavaFx - but I'm no expert on this. Gateway's login dialog doesn't have this problem.

acrive82 commented 8 months ago

Yes, with Oracle JDK 8 works perfectly!

Thanks!