dvasdekis / ib-gateway-docker-gcp

Leaner and Faster Interactive Brokers Docker Trading Gateway
MIT License
68 stars 19 forks source link

Error: Could not find or load main class #19

Open Vincentho711 opened 3 years ago

Vincentho711 commented 3 years ago

Upon running docker-compose up, I ran into Error: Could not find or load main class. The full log is as below:

tws_1   | 2021-01-31 10:44:09,703 INFO spawned: 'ibcontroller' with pid 196
tws_1   | 
tws_1   | ================================================================================
tws_1   |
tws_1   | Starting IBC version  on 2021-01-31 at 10:44:09
tws_1   |
tws_1   | Operating system: Linux 44a52400c769 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
tws_1   |
tws_1   | Arguments:
tws_1   |
tws_1   | TWS version = 978
tws_1   | Entry point = ibcalpha.ibc.IbcGateway
tws_1   | --tws-path = /root/Jts
tws_1   | --tws-settings-path = /root/Jts
tws_1   | --ibc-path = /opt/IBController
tws_1   | --ibc-ini = /root/IBController/IBController.ini
tws_1   | --mode = paper
tws_1   | --java-path = /opt/i4j_jres/1.8.0_152-tzdata2019c/bin
tws_1   | --user = ***
tws_1   | --pw = ***
tws_1   | --fix-user =
tws_1   | --fix-pw =
tws_1   |
tws_1   | =================================
tws_1   | Generating the classpath
tws_1   | Classpath=/root/Jts/ibgateway/978/jars/jts4launch-978.jar:/root/Jts/ibgateway/978/jars/locales.jar:/root/Jts/ibgateway/978/jars/log4j-api-2.5.jar:/root/Jts/ibgateway/978/jars/log4j-core-2.5.jar:/root/Jts/ibgateway/978/jars/total-2018.jar:/root/Jts/ibgateway/978/jars/twslaunch-978.jar:/root/Jts/ibgateway/978/jars/twslaunch-install4j-1.9.jar:/opt/IBController/IBC.jar
tws_1   |
tws_1   | Generating the JAVA VM options
 -XX:+ExitOnOutOfMemoryErrorPercent=45
tws_1   |
tws_1   | Determining the location of java executable
tws_1   | Location of java executable=/opt/i4j_jres/1.8.0_152-tzdata2019c/bin
tws_1   |
tws_1   | Starting Gateway with this command:
tws_1   | "/opt/i4j_jres/1.8.0_152-tzdata2019c/bin/java" -cp "/root/Jts/ibgateway/978/jars/jts4launch-978.jar:/root/Jts/ibgateway/978/jars/locales.jar:/root/Jts/ibgateway/978/jars/log4j-api-2.5.jar:/root/Jts/ibgateway/978/jars/log4j-core-2.5.jar:/root/Jts/ibgateway/978/jars/total-2018.jar:/root/Jts/ibgateway/978/jars/twslaunch-978.jar:/root/Jts/i ibcalpha.ibc.IbcGateway "/root/IBController/IBController.ini" *** *** paper
tws_1   |
tws_1   | Error: Could not find or load main class
tws_1   | Gateway finished
tws_1   |
tws_1   | 2021-01-31 10:44:09,899 INFO exited: ibcontroller (exit status 1; not expected)

Any idea on why this error has occurred?

dvasdekis commented 3 years ago

Can you confirm which branch you're using? v978 shoudn't have this issue, but v980 might.

admer7 commented 3 years ago

Hello,

i have exactly the same issue when I try to build the docker image by my own via docker-compose. Im using the v978 branch as you suggested.

Is there a way to change the IB-Gateway Port from 4004 to 4002 without port mapping?

admer7 commented 3 years ago

The problem in my case was connected with: ibgateway.vmoptions.

Comment out this and the next line in the Dockerfile.