java.lang.NoSuchMethodError: com.MyClass._persistence_checkFetched [message #383826] |
Thu, 27 November 2008 08:11 |
Eclipse User |
|
|
|
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 #384216 is a reply to message #384211] |
Thu, 04 December 2008 08:44 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04779 seconds