I'm a bit confused by your question. The code snippet is for SPY stock, but the error is for SPX index. SPY trades on a bunch of exchanges, and the SMART exchange collects data for all of them. However, the SPX index is only published by CBOE, so if that is what you're looking for, try something like this:
Contract contract = new Contract();
contract.symbol("SPX");
contract.secType("IND");
contract.currency("USD");
contract.exchange("CBOE");
m_client.reqRealTimeBars(3010, contract, 5, "TRADES", false, null);