Announcement Announcement Module
No announcement yet.
Bizarre behaviour: java.lang.NoSuchMethodError: Person._persistence_checkFetched Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bizarre behaviour: java.lang.NoSuchMethodError: Person._persistence_checkFetched

    java.lang.NoSuchMethodError: com.fred.Person._persistence_checkFetched(Ljava/lang/String;)V
    	at com.fred.entity.Person._persistence_getclient(
    	at com.fred.entity.Person._persistence_setclient(
    	at com.fred.entity.Person.setClient(
    	at com.fred.entity.PersonPersistenceTests.testSaveClientWithItems(
    I get the above exception when I run my maven unit tests but not when the application is deployed. I assume the error is associated with JPA & version management. The Spring configuration is identical.
    What is bizarre is that its not all my Entities, just some of them. And if I pull the code from the BaseEntity into the Entities (e.g. Person) and remove the 'extends BaseEntity' all the unit tests work. I assume the _persistence_xx methods are woven methods, so I am at a loss how to diagnose the problem. I've tried re-importing projects into clean workspace.

    Any ideas greatfully received.

    public class Person extends BaseEntity implements Serializable, DomainObject {
    	private static final long serialVersionUID = 1L;
    	@ManyToOne(targetEntity=Client.class, cascade=CascadeType.PERSIST)
    	private Client client;
         public void setClient(Client client) {
    		this.client = client;
        public Client getClient() {
    		return client;
    public abstract class BaseEntity {
    	private Long id;
    	private Integer version;
    	public void setId(long id) { = id;
    	public Long getId() {
    		return id;
    	public Integer getVersion() {
    		return version;
    	public void setVersion(Integer version) {
    		this.version = version;
    	public boolean isNew() {
    		return ( == null);

  • #2
    The error you are seeing is caused by a JDK (Java Development Kit) version incompatibility. Errors like this occur when you compile a class with one version of the JDK, then run them with an older JVM (Java Virtual Machine).



    • #3
      Thanks for the feedback Gilbertoca, unfortunately I'm only using a single JDK 1.6.0_26 with compiler and execution environments pointing to the same. Currently I'm at a loss to understand what is going on. I sort of think I have some metadata hanging around somewhere but I've tried most of the rebuild strategies i can think of. I did have older 1.6 JREs which I removed - I wondering if something got corrupted in that process - some more investigation required.


      • #4

        At the moment I believe the problem has to do with EclipseLink + jpa 2, as If I replace Eclipselink with Hibernate the problem goes way - all other things remaining as before.

        org.eclipse.persistence: javax.persistence: 2.0.3
        org.eclipse.persistence: eclipselink: 2.3.0

        Hibernate: jpa-api: 2.0-cr-1
        org.hibernate: hibernate-entitymanager: 3.6.6.Final

        The only thing i can think of is a mismatched set of eclipse jars?