×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    15

    No exception but code aborts

    I've got some bluetooth code that is behaving strangely. When any class method is called on a javax.bluetooth.ServiceRecord object, the code execution stops.

    And when it fails it does not throw an exception (I've put it in a try-catch) and it does not in any other way indicate that there has been an application error. It's as if the method call gets executed as if it was just a 'return' statement.

    Debug lines following it are not executed and neither is the catch code. No 'application error' pop up is presented like i've seen before with uncaught exceptions.

    I'm at a complete loss.

    Where do the stdout and stderr messages go on a nokia phone (the app behaves the same on a 6600 and 7610)? Is there some log somewhere that I should be checking to find out what goes wrong?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    1
    I'm new to J2ME but in J2SE I would try to catch a Throwable object instead of a normal Exception. Throwable is the common ascestor of Exception and Error classes. It is usually not a good idea to catch Errors, but if that's what's happening you will have a clue about the problem.

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    15

    Exception vs Error

    Doh, that never occurred to me! You're so right, after changing to Throwable, I got this output:

    java.lang.IncompatibleClassChangeError: 97

    That's progress!

    I've modified my code to work against any RemoteDevice instead of just the GPS unit. When scanning for services against other devices (such as my powerbook, using UUID 0008) the exact same thing happens: I can get a ServiceRevord but trying to call methods on it gives this error.

    Is there something wrong with the ServiceRecord class installed on these Nokias?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×