Reputation: 447
I'm using DTO to map my DB to a Java object.
I had an error like this doku.eds2.dto.Transaction.getListedStatus()Ljava/lang/Character;
I have checked my Transaction.java file, it contains the getListedStatus() method.
@Column(name="listed_status", length=1)
public Character getListedStatus() {
return this.listedStatus;
}
public void setListedStatus(Character listedStatus) {
this.listedStatus = listedStatus;
}
and also my table contains this field :
Column | Type | Modifiers
listed_status | character(1) |
How can I fix this error?
Thank in advance.
Upvotes: 2
Views: 1800
Reputation: 2251
This sort of error often happens if you have two different versions of a class, one with the method and one without. If the one without the method ends up in the classpath earlier than the one with, then you will get an error like this.
Make sure that your classpath does not contain any other classes of the type "doku.eds2.dto.Transaction". If you're in Eclipse, you can do this by pressing Ctrl-Shift-T and entering the class name into the search. If you get multiple matches, you probably have a class path or dependency problem.
Upvotes: 4