softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

TWS.Session.getInstance #82

Closed purchagent closed 4 years ago

purchagent commented 4 years ago

Hi Abel, This is the response I get when trying to run "session = TWS.Session.getInstance();"

Warning: The following error was caught while executing 'TWS.Session' class destructor: Dot indexing is not supported for variables of this type. Error in TWS.Session/delete (line 83) this.eClientSocket.eDisconnect(); Error in TWS.Session (line 18) this.handler = com.tws.Handler(); Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();

In TWS.Session (line 18) In TWS/Session/getInstance (line 94) Error using ProxyBuilder/resolveClassForMethod (line 170) Java exception occurred: java.lang.SecurityException: sealing violation: package com.ib.client is sealed at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:400) at java.net.URLClassLoader.definePackageInternal(URLClassLoader.java:420) at java.net.URLClassLoader.defineClass(URLClassLoader.java:452) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at com.mathworks.jmi.CustomURLClassLoader.findClass(ClassLoaderManager.java:760) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) 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();

softwarespartan commented 4 years ago

Thanks for reaching out.

Can you send the output of the “ver” command

Thanks

Sent from my iPhone

On Dec 17, 2019, at 9:59 PM, purchagent notifications@github.com wrote:

Hi Abel, This is the response I get when trying to run "session = TWS.Session.getInstance();"

Warning: The following error was caught while executing 'TWS.Session' class destructor: Dot indexing is not supported for variables of this type. Error in TWS.Session/delete (line 83) this.eClientSocket.eDisconnect(); Error in TWS.Session (line 18) this.handler = com.tws.Handler(); Error in TWS.Session.getInstance (line 94) localInstance = TWS.Session();

In TWS.Session (line 18) In TWS/Session/getInstance (line 94) Error using ProxyBuilder/resolveClassForMethod (line 170) Java exception occurred: java.lang.SecurityException: sealing violation: package com.ib.client is sealed at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:400) at java.net.URLClassLoader.definePackageInternal(URLClassLoader.java:420) at java.net.URLClassLoader.defineClass(URLClassLoader.java:452) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at com.mathworks.jmi.CustomURLClassLoader.findClass(ClassLoaderManager.java:760) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) 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();

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

purchagent commented 4 years ago

MATLAB Version: 9.7.0.1190202 (R2019b) Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 18362) Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Thanks

softwarespartan commented 4 years ago

Thanks. I was hoping also to see if you had the trading toolbox installed

On Dec 17, 2019, at 10:32 PM, purchagent notifications@github.com wrote:

MATLAB Version: 9.7.0.1190202 (R2019b) Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 18362) Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

purchagent commented 4 years ago

I thought you were asking about Windows, Matlab and Java. yes I have the trading toolbox installed Trading Toolbox Version 3.6 (R2019b) Thanks

Despair2000 commented 4 years ago

Uninstall the trading toolbox and try again.

softwarespartan commented 4 years ago

@purchagent the trading toolbox uses alternate version of java and puts a jar file in the class path that can't get in front of. A questionable design choice if you ask me but Mathworks can do whatever they want. Until can find a way to "quarantine" the trading toolbox, need to uninstall for IB4m to work.

purchagent commented 4 years ago

thank you both for your assistance uninstalling trading toolbox allowed me to connect

chowyik commented 3 years ago

i face the same problem but ................Uninstall the trading toolbox and try again. doesn't work

softwarespartan commented 3 years ago

Can you share the error you’re getting. Also can you share the output of the ‘ver’ command.