• 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

NoSuchMethodError while accessing a POJO

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Had posted this in the Struts section, but decided this was a better forum to address this issue.

I have an action class ProfileDetailAction, which implements the getter/setter methods related to Profiles. I have 2 classes RegistrationAction and AlterProfileAction extending from it.

I have an EJB 3.0 entity class called ProfileDetail which is mapped to an underlying table in MySQL.

ProfileDetailAction.java:




RegistrationAction.java:



ProfileDetail.java:



The firstName variable in ProfileDetail action is getting filled properly (I am able to see them in debug mode.)
When setFirstName() gets called in RegistrationAction, I get the following error:


java.lang.NoSuchMethodError: com.justbooks.entities.ProfileDetail.setFirstName(Ljava/lang/String



I am not sure whether this is a classloader problem, or I am doing something wrong. I am using JBoss, with MySQL DB. I am using Eclipse, and the IDE does not throw up any errors too.

I have only one Java version on my laptop, jdk1.5.0_01, which is being used by both Eclipse (my IDE) and JBoss (my App Server). I saw quite a number of posts on the net indicating it might be a version mismatch. But I dont think that applies to this situation.

Any clue welcome...
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try changing "firstName" to "firstname"
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pankaj Tiwari:
try changing "firstName" to "firstname"



Would that actually matter ?
 
Subhash Bhushan C
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Copy-Paste]
Solved it...


You guys wont believe what the problem was...
JBoss was not replacing old class files with new files in a new EAR. So, the first version of the file was being reference. Once I cleaned up the deployment directory, everything worked just fine...

Thanks for the help, Anand...
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic