Bookmark Topic Watch Topic
  • New Topic

noSuchMethod exception

 
Mahesh Bamane
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, I've been dealing with a big problem. I have two classes which has same class name and package structure they are present in two different jars for sure.
When I call a method of one class say for example setName.
I get an exception saying noSuchMethod; what can be the possible soluntion in this regard.
As classes are in jars I cant make any changes to them.
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
As long those jars are not signed (and in some cases even if they are) you can rename jar file to zip and do all the changes you want.
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
You don't even need to rename them; JAR files can be opened with all ZIP applications just fine.

But two versions of a class seems like a bad design. Is this a class written by yourself or a colleague, or did you get the JAR files from the Internet?
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
And next time, UseOneThreadPerQuestion. We'll continue here.
 
    Bookmark Topic Watch Topic
  • New Topic