Using the Java API (and I guess this goes for any other TWS Interactive Brokers client API) I get an error "No security definition has been found for the request" The FAQ and other resources were resoundingly unhelpful.
Contract contract = new Contract();
int id = incId;
System.out.println("Oder Id " + id );
// use UTC seconds as transaction id
// This is the problem you need to have a blank contractId
contract.m_conId = 12345;
contract.m_symbol = signal.symbol;
contract.m_secType = "STK";
contract.m_expiry = "";
contract.m_strike = 0;
contract.m_exchange = "SMART";
contract.m_primaryExch = "ISLAND";
contract.m_currency = "USD";
//etc
Order order = new Order();
// set order fields
order.m_account = "XXXXXX";
order.m_orderId = id;
//etc
GetInstance().wrapper.m_client.placeOrder(id, contract, order);
The key here is that the contractId field should be left blank. Submitting with a contractId causes a security error.