I am having trouble in testing a Midlet. I am using j2me sdk 3, the Midlet builds successfully, but when i try to run it, it fails and it shows the following message in the log:
Failed to connect to device {0}!
Reason:
Emulator {0} terminated while waiting for it to register!
I had the same problem. On the next system restart there where message about runMidlet crash due to DEP (Data Execution Prevention).
After turning off DEP all started to work perfect.
In case it could help, it was on Win2003, Java ME SDK 3.0.
UPDATE:
I advise to turn off DEP for all programs (it is "Turn on DEP for essential Windows programs and services only" option).
In my case turning off DEP for single runMidlet.exe had only temporary effect.
See also Java ME SDK Team blog entry on this
You probably need to increase the debugger timeout value. I work in WTK 2.5.x so I'm not sure where this setting is exposed (are you on Netbeans?) in version 3.0.
Somewhat out-of-date instructions for Eclipse and Netbeans.
Just go to tools/java platform, select the CLDC Framework blah blah blah and Click refresh.
If you are using Linux as your operating system just you need to type the command 'setenforce permissive' in the terminal.It will solve the issue.
Rishabh
Aside from the DEP issue mentioned in other answers, there is a useful list of solutions to common problems here.