BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-03-2009, 10:11 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default NoClassDefFoundError happens only on OS 5.0

Please Login to Remove!

I have an application that ran flawlessly on OSes 4.2.1, 4.5, 4.6, and 4.7. Unfortunately, it is having a problem on OS 5.0 - it mostly works, but whenever the user tries to go to a particular screen, nothing happens in the UI and the BlackBerry's event log shows the following error:

NoClassDefFoundError

Can anyone think of a reason why the screen's class would not be found in OS 5.0 only? Or a suggestion for how I might work around this?

For reference, the application is compiled using RAPC on the command line, and is distributed using OTA deployment.
Offline  
Old 11-03-2009, 10:12 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

For reference, I believe something similar may be happening to BeeJive:
BeeJive on New OS - BlackBerry Forums at CrackBerry.com
Offline  
Old 11-03-2009, 10:38 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You need to pull the event log from the device and get the full stack trace.

My guess is that the application uses a deprecated constructor which was removed in 5.0 (there are several).
Offline  
Old 11-05-2009, 09:47 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestion, Dougsg38p! I did pull a stack trace. The odd thing is, it's definitely throwing the error when I try to instantiate *one of my own classes*. I have a particular Screen that, whenever I try to use it (in several different places in the app), my app bombs out with this NoClassDefFoundError. I added some logging to verify that the error is definitely happening when I try to instantiate this class, not before or after.

It's very odd to me that one of my own classes could "go missing" from an app that works as-is on OS 4.7 and earlier. I added some logging in the constructor for this class - the constructor is not even being called (and is not present in the stack trace).

Any ideas would be very helpful!
Offline  
Old 11-05-2009, 10:22 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Perhaps you screen is throwing the exception because it is attempting to instantiate a text field using a constructor that no longer exists?

The only other suggestion is that you are missing a COD file?
Offline  
Old 11-05-2009, 11:08 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Indeed - when I remove all the interesting contents of that screen, it runs fine (although of course it's empty) - no error occurs. I will have to try re-adding elements to the screen one by one until it breaks again, ugh!
Offline  
Old 11-05-2009, 05:44 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

For the record, in case it helps anyone else, here is the deprecated constructor that I was calling that throws this NoClassDefFoundError on OS 5.0:

TextField(String label, String value, int maxLength, long style)

I changed it to an EditField, and now everything works fine:

EditField(String label, String value, int maxLength, long style)

I wish that RAPC would catch this at compile time.
Offline  
Old 11-05-2009, 06:46 PM   #8 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You are welcome.

Offline  
Old 11-05-2009, 06:49 PM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Verizon
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Appreciate it!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.