aspose file tools
The moose likes Java Micro Edition and the fly likes Callback threw IllegalArgumentException error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Callback threw IllegalArgumentException error" Watch "Callback threw IllegalArgumentException error" New topic
Author

Callback threw IllegalArgumentException error

Bill Denniston
Greenhorn

Joined: Aug 26, 2008
Posts: 6
I'm writing an MIDP 2.0 MIDlet application in Neteans 6.5, using the Nokia S60 emulator. The MIDlet was created using the Visual MIDlet design feature of Netbeans. It's a simple form that accepts a numeric entry and plays an audio file.

The commandAction method created by Netbeans is where everything happens. When the "OK" command on the phone is invoked, a value is retrieved from a text field (key) and mapped to an audio file (value) in a Hashtable. This whole process is in a try - catch block that catches all the known exceptions to expect (including InvalidArgumentException), and it executes without exceptions when the entered value maps to a valid audio file. I test for an invalid key at the top of the try - catch block and bypass everything if it does not properly map. I expect that nothing should happen when an invalid entry is given, and no exception is trapped by the try - catch block.

However, when an entry is given that does not map to a valid audio file (i.e. Hashtable.get() returns null), the try - catch does not trap an exception, but an InvalidArgumentException is thrown by "Callback". I don't know what is throwing this exception. It is not happening in the commandAction try - catch which is substantively all there is in the method. No stack trace or other diagnostic is provided, just the notation on the command line that Callback threw the exception. The phone emulator also reports (embarassingly) to the user that an "Unhandled exception" has occurred and asks if the application (MIDlet) should be closed. (If the MIDlet is allowed to continue to execute, it takes the next entry just fine and either works like a champ or exhibits the same poor behavior again depending upon the validity of the entry.

Any ideas on where to hunt down the Callback exception would be appreciated. Thanks.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Callback threw IllegalArgumentException error
 
Similar Threads
How do i run Midlet on Series40 (6230 emulator)
remote debugging with WTK emulator
"Failed to Install the MIDlet"
Recording midlet with save function
Callback threw IllegalArgumentException error