我正在使用 Jaxb,Unmarshalling an xml。我正在使用 java 1.6。这是通过 JWSDP 2.0 生成的类。(xjc.bat) 但我的问题是我无法编译生成的类。我收到如下所示的语法错误。
“类型不匹配:无法从 XmlAccessType 转换为 AccessType”
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)// here i am getting sytax error
@XmlType(name = "personinfo", propOrder = {
"firstname",
"lastname",
"address"
})
public class Personinfo {
@XmlElement(required = true)
protected String firstname;
@XmlElement(required = true)
protected String lastname;
@XmlElement(name = "Address", required = true)
protected PersonAddress address;
............................
任何人都可以在这方面提供帮助,