Crow,
the issue with your code is not the .setConnectOptions("+PACEAPI") call. It is rather the location (timing) of the reqPosition() and reqMarketDataType() calls.
You might want to reread the section in the API Reference Guide. You should not send any request toe TWS API until you have received the BApi.EWrapper.nextValidID callback. That is your indication that all API components have been initialized properly and messages can flow in both directions. Your code calls reqPosition() and reqMarketDataType() before that callback has arrived.
There are other areas that can be improved. The ApiContoller.java file in the IBKR API distribution is a very good example of how you might want to structure your interface with the TWS API.
´³¨¹°ù²µ±ð²Ô