Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling NoSuchMethodError

 
Moguluri Ravi Kiran
Ranch Hand
Posts: 63
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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]
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4682
333
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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..
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • 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.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic