Invalid operating mode exception message

If you launch an application and you see the "com.digi.xbee.api.exceptions.InvalidOperatingMode" exception, review the following solutions.

com.digi.xbee.api.exceptions.InvalidOperatingModeException: Could not determine operating mode.
	at com.digi.xbee.api.XBeeDevice.open(XBeeDevice.java:211)
	at com.digi.xbee.sendreceivedatasample,MainApp.main(MainApp.java:43)

In this case, the library cannot access the module. Check that the PORT constant is correct.

com.digi.xbee.api.exceptions.InvalidOperatingModeException: Unsupported operating mode: AT mode
	at com.digi.xbee.api.XBeeDevice.open(XBeeDevice.java:214)
	at com.digi.xbee.sendreceivedatasample.MainApp.main(MainApp.java:43)

This indicates the module is in transparent mode. Change the AP parameter through XCTU to be API enabled [1].