• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ClassNotFoundException vs NoClassDefFoundError

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the difference between these two as in CLDC1.1 API:
1. java.lang.NoClassDefFoundError
2. java.lang.ClassNotFoundException
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

Since the libraries included in CLDC are generally intended to be highly compatible with J2SE libraries, the library classes included in CLDC shall throw precisely the same exceptions as regular J2SE classes do. Consequently, a fairly comprehensive set of exception classes has been included.



java.lang.ClassNotFoundException fits into this category and is an Exception and could be caught in a try/catch block
whereas
java.lang.NoClassDefFoundError is an error and is covered by this paragraph in the spec.

In contrast, as explained in Section 4.2 �Exception and Error Handling Limitations,� the error handling capabilities of CLDC are limited. By default, a virtual machine conforming to CLDC is required to support only the error classes listed below in Section 6.2.7.2 �Error classes.�


Errors cannot be caught in code and will terminate MIDlet execution.
Hope that helps.
 
Ceppad Reso
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it, thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic