下XStream和它總是給我的例外: nodecom.thoughtworks.xstream.mapper.CannotResolveClassException
nodecom.thoughtworks.xstream.mapper.CannotResolveClassException同時使用水壺
然後我分開審訊我的代碼來自Kettle和一個簡單的Java應用程序。它工作正常。 例如:
public static void main(String[] args) {
person p = new person("JJ", "MM");
XStream xstream = new XStream(new DomDriver());
xstream.alias("personname", person.class);
String xml = xstream.toXML(p);
person pp = (person) xstream.fromXML(xml);
System.out.println(pp.toString());
}
public class person {
private String firstname;
private String lastname;
public person(String first, String last) {
this.firstname = first;
this.lastname = last;
}
public String getFirstname() {
return this.firstname;
}
public String getLastname() {
return this.lastname;
}
public void setFirstname(String name) {
this.firstname = name;
}
public void setLastname(String name) {
this.lastname = name;
}
}
並且此代碼正常工作。 但是,當我將此代碼移動到Kettle插件時,它在從XML文件讀取元數據的步驟中失敗。
任何想法* *爲什麼這是需要的? – Baczek 2012-09-12 08:47:07