This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes NoSuchMethodError while accessing a POJO Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "NoSuchMethodError while accessing a POJO" Watch "NoSuchMethodError while accessing a POJO" New topic
Author

NoSuchMethodError while accessing a POJO

Subhash Bhushan C
Ranch Hand

Joined: Jan 27, 2005
Posts: 106
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...


Regards,<br />Subhash Bhushan.
Pankaj Tiwari
Ranch Hand

Joined: Sep 11, 2005
Posts: 55
try changing "firstName" to "firstname"
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

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


Would that actually matter ?
Subhash Bhushan C
Ranch Hand

Joined: Jan 27, 2005
Posts: 106
[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...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: NoSuchMethodError while accessing a POJO
 
Similar Threads
NoSuchMethodError while accessing Entity bean via a Struts Action
Help with JPA
Need help with Reverse Engineering to create JAVA objects
Could not resolve a persistence unit corresponding to the persistence-context-ref-name
compilation error when comping entity bean