Closed kevinhedgefund closed 4 years ago
Thanks for opening an issue. This usually happens if the Mathworks Trader Toolbox is installed also. The trader toolbox installs version of the API on the Java class path that i've not been able to get in front of, so requires choosing which one to have installed. I realize that's not optimal.
Thanks for your reply!! I uninstalled Matlab and reinstalled without a trading toolbox. But, I have the same error. So, It seems like the errors aren't from the trading toolbox.
OK, a few things come to mind here
can you just copy paste the output of the ver
command (remove you're license number though). For example, I just did reinstall a few days ago and mine is
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.7.0.1247435 (R2019b) Update 2
MATLAB License Number: XXXXXXXX
Operating System: Mac OS X Version: 10.15.3 Build: 19D76
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.7 (R2019b)
Automated Driving Toolbox Version 3.0 (R2019b)
Communications Toolbox Version 7.2 (R2019b)
Computer Vision Toolbox Version 9.1 (R2019b)
DSP System Toolbox Version 9.9 (R2019b)
Deep Learning Toolbox Version 13.0 (R2019b)
Image Processing Toolbox Version 11.0 (R2019b)
MATLAB Coder Version 4.3 (R2019b)
Parallel Computing Toolbox Version 7.1 (R2019b)
Phased Array System Toolbox Version 4.2 (R2019b)
Signal Processing Toolbox Version 8.3 (R2019b)
Statistics and Machine Learning Toolbox Version 11.6 (R2019b)
Can you also share the command you use to add the IB4m/Jar/TWS973.jar to your java path?
Finally, can you confirm you're getting exactly same error message after you've removed trading toolbox?
The error
java.lang.SecurityException: sealing violation: package com.ib.client is sealed
likely indicates the wrong IB API is in the MATLAB java path since com.ib.client
is not sealed in TWS973.jar provided with IB4m.
1.
ver
MATLAB Version: 9.6.0.1214997 (R2019a) Update 6 MATLAB License Number: 40685530 Operating System: Mac OS X Version: 10.15.3 Build: 19D76 Java Version: Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Version 9.6 (R2019a) Database Toolbox Version 9.1 (R2019a) Datafeed Toolbox Version 5.8.1 (R2019a) Econometrics Toolbox Version 5.2 (R2019a) Financial Instruments Toolbox Version 2.9 (R2019a) Financial Toolbox Version 5.13 (R2019a) GUI Layout Toolbox Version 2.2.1 (R2015b) Optimization Toolbox Version 8.3 (R2019a) Parallel Computing Toolbox Version 7.0 (R2019a) Risk Management Toolbox Version 1.5 (R2019a) Statistics and Machine Learning Toolbox Version 11.5 (R2019a) Text Analytics Toolbox Version 1.3 (R2019a)
- javaaddpath(fullfile(pwd,'Jar','TWS973.jar'))
- AccountSummaryExample Undefined variable "com" or class "com.tws.Handler".
Error in TWS.Session (line 18) this.handler = com.tws.Handler();
Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();
Error in AccountSummaryExample (line 9) session = TWS.Session.getInstance();
I had javaclasspath.txt. After erasing the file, errors are changed. but, I can't still connect to IB.
Thanks!!
javarmpath and then javaaddpath(fullfile(pwd,'Jar','TWS973.jar')) did again. Now I can connect to IB. Thanks for your help!!
Error in TWS.Session/delete (line 83) this.eClientSocket.eDisconnect();
Error in TWS.Session (line 15) function this = Session()
Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();
Error in AccountSummaryExample (line 9) session = TWS.Session.getInstance();
Error in ProxyBuilder/initForMethod (line 114) targetClass = this.resolveClassForMethod(varargin{1});
Error in TWS.Session (line 24) [this.proxy,~] = proxyBuilder.initForMethod('TWSNotification','TWS.processNotification');
Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();
Error in AccountSummaryExample (line 9) session = TWS.Session.getInstance();
ibapi version is 9.73.02. java version is 1.8.0-241. OS is macOS Catalina v10.15.3. Matlab version is R2019a.