Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched
java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched [message #383826] Thu, 27 November 2008 08:11 Go to next message
Eclipse UserFriend
Originally posted by: buck.bazooka.gmail.com

Hi,

I have just migrated my quite big application from Toplink to EclipseLink
and everything seems to work fine except for a class hierarchy where I
access a getter in a subclass which was defined in a superclass as
abstract. When I access the getNr method on MyClass an exception is thrown:

java.lang.NoSuchMethodError:
com.MyClass._persistence_checkFetched(Ljava/lang/String;)V
at com.ag.MyClass._persistence_getnr(MyClass.java)
at com.ag.MyClass.getOrd(MyClass.java:63)
at com.ag.Controller.getItems(Controller.java:107)
at com.ag.SPController.getSp(SPController.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.web.servlet.mvc.multiaction.MultiActionC ontroller.invokeNamedMethod(MultiActionController.java:473)
at
org.springframework.web.servlet.mvc.multiaction.MultiActionC ontroller.handleRequestInternal(MultiActionController.java:4 10)
...


My class hierachy is organize like this:

---------------------------------------------------
@MappedSuperclass
@EntityListeners({AuditListener.class})
public abstract class AuditableImpl implements Auditable {
@Embedded
private AuditRecord auditRecord;

/* (non-Javadoc)
* @see com.zen.bls.domain.Auditable#getCreationDate()
*/
@Override
public Date getCreationDate() {
if(auditRecord == null)
return null;
else
return auditRecord.getCreationDate();
}

/* (non-Javadoc)
* @see com.zen.bls.domain.Auditable#getCreationUser()
*/
@Override
public User getCreationUser() {
if(auditRecord == null)
return null;
else
return auditRecord.getCreationUser();
}

/* (non-Javadoc)
* @see com.zen.bls.domain.Auditable#getModificationDate()
*/
@Override
public Date getModificationDate() {
if(auditRecord == null)
return null;
else
return auditRecord.getModificationDate();
}

/* (non-Javadoc)
* @see com.zen.bls.domain.Auditable#getModificationUser()
*/
@Override
public User getModificationUser() {
if(auditRecord == null)
return null;
else
return auditRecord.getModificationUser();
}
}

---------------------------------------------------
@Entity
@DiscriminatorColumn(name="HW_TYPE")
public abstract class Hardware extends AuditableImpl{
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator = "seq_ph")
private long id;

public Hardware() {
}

public long getId() {
return id;
}

public void setDescription(String description) {
this.description = description;
}

public String getDescription() {
return description;
}

protected abstract String getName();
public abstract int getOrd();
}
-------------------------
@Entity
@DiscriminatorValue("EB_HW")
public class MyClass extends Hardware {
private int nr;

public MyClass() {
super();
}

public void setNr(int nr) {
this.nr = nr;
}

public int getNr() {
return nr;
}

@Override
public int getOrd() {
return nr;
}

@Override
protected String getName() {
return "MyClass";
}
}
-----------------------------------------------

I have tried both eclipseLink 1.0.2 and 1.1.0.r2782.M4.
I am also using Spring. I have tried 2.5.5 and the latest 2.5.6.
I am also using spring-tomcat-weaver.jar.

Can someone please tell me what they think about this exception? I know
that EclipseLink is weaving in some methods in my class but I don't
understand why it does not find
"_persistence_checkFetched(Ljava/lang/String;)V"

Thanks for your help.

Buck
Re: java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched [message #384211 is a reply to message #383826] Mon, 01 December 2008 14:28 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

This is very odd. It is possible that it could have something to do with
Spring, could you please confirm if it occurs in JSE without Spring?

Is this the only class you have issues with, or do you have errors in
other classes? It seems it may be a bug, in which case please log the bug
in Bugzilla.

A workaround should be to either turn weaving off, or just turn off the
weaving of fetch-groups.

"eclipselink.weaving.fetchgroups"="false"
or if that doesn't work,
"eclipselink.weaving"="false"

----
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched [message #384216 is a reply to message #384211] Thu, 04 December 2008 08:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: buck.bazooka.gmail.com

Hi,

Thanks for your reply James.
It is for me very hard to try making my application work without Spring.
So this part I will not try for now.

On the bright side, I have tried disabling eclipse link weaving. And
wow... it seems to work now very well.

My app does not work with

<property name="eclipselink.weaving.fetchgroups" value="false" />

But it does with

<property name="eclipselink.weaving" value="false" />

Thanks again

Buck
Re: java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched [message #384221 is a reply to message #384216] Thu, 04 December 2008 14:15 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What error do you get with,

<property name="eclipselink.weaving.fetchgroups" value="false" />

?


James : Wiki : Book : Blog : Twitter
Previous Topic:Ñ character mapping problem
Next Topic:unusual exceptionrelating relational descriptor
Goto Forum:
  


Current Time: Thu Mar 28 16:18:27 GMT 2024

Powered by FUDForum. Page generated in 0.02275 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top