• 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

Handling NoSuchMethodError

 
Ranch Hand
Posts: 63
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello & hi to each & every JavaRancher






is there any way to handle the Exception Caused here.

Thanks & Regards..

[Devaka: Added a meaningful subject line]
 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Moguluri Ravi Kiran wrote:is there any way to handle the Exception Caused here.


No - and you should NOT.
 
Moguluri Ravi Kiran
Ranch Hand
Posts: 63
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Devaka Cooray

you said "There is no way"
& "WE SHOULD NOT"..

may i know ,why you said "we should not"..
is there any significant reason for that..
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Moguluri Ravi Kiran wrote:Dear Devaka Cooray

you said "There is no way"
& "WE SHOULD NOT"..

may i know ,why you said "we should not"..
is there any significant reason for that..


Because you try to instantiate a class from inside a static initializer block of this class.
This class is not initialized yet- it's not ready to be used.
This is like when your car is repaired in a garage, it is now without tires and oil, but you try to fire an engine and drive to home
- no way, it's impossible.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A java application client program needs a main method to start its execution from. Your program does not have this.

Also, errors should never be handled, although you can handle them by catching them.An error is meant to specify that your program execution cannot continue for any reason.
 
reply
    Bookmark Topic Watch Topic
  • New Topic