简体   繁体   中英

java.lang.NoSuchMethodError with XML

I have the following XML

@XmlRootElement
@XmlType(propOrder = { "name", "transforms", "qualitycontrols"})
@XmlAccessorType(XmlAccessType.NONE)
public class Process {

@XmlElement
private String name;      

@XmlElement(name = "transform")
private List<Transform> transforms = new ArrayList<Transform>();

@XmlElement(name = "qualitycontrol")
private List<QualityControl> qualitycontrols = new ArrayList<QualityControl>();

public Process() {
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}  

public void add(Transform transform) {
    transforms.add(transform);
}

public List<Transform> getTransforms() {
    return transforms;
}

public List<QualityControl> getQualitycontrols() {
    return qualitycontrols;
}

public void add(QualityControl qualitycontrol) {
    qualitycontrols.add(qualitycontrol);
}
}

The transform node works just fine and I added the qualitycontrol node which is not working.

@XmlRootElement(name="qualitycontrol")
@XmlType(propOrder = { "template"})
public class QualityControl {

private String template;

public QualityControl() {
}

public String getTemplate() {
    return template;
}

public void setTemplate(String template) {
    this.template = template;
}

}

When I use public static main to test this code everything works fine but when it gets deployed to the server I get this message: ERROR [ProcessMDB] java.lang.NoSuchMethodError: model.Process.getQualitycontrols()Ljava/util/List;

What am I missing ?? All help is highly appreciated.

Thanks Joey.

Thanks to user714965 !! I deleted the jar and I was still getting the same error. So I looked for the jar and found that it was in the lib of another ear. After deleting that ear, things started breaking. After rebuilding the ear, the method was found !! No more java.lang.NoSuchMethodError. Thanks again !! Spent a lot of time on this one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM