I keep getting this error and my application won't start, should I have this in a try { block ?
Unmarshal
File file = new File("xmlFiles/ipAdresses.xml");
JAXBContext jaxbContext = JAXBContext.newInstance(IpAdressListXmlHandler.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
IpAdressListXmlHandler xmlList = (IpAdressListXmlHandler) jaxbUnmarshaller.unmarshal(file);
System.out.println(xmlList);
no file, I deleted it
the class
@XmlRootElement
public class JAXBHandler {
private String serverid;
private String clientFileDir;
private String serverFileDirectory;
private int port;
public void setPort(int port) {
this.port = port;
}
public void setClientFileDir(String dir) {
this.clientFileDir = dir;
}
public void setServerFileDirectory(String serverDir) {
this.serverFileDirectory = serverDir;
}
public void setServerId(String serverId) {
this.serverid = serverId;
}
@XmlElement
public String getServerid() {
return serverid;
}
@XmlElement
public String getClientFileDir() {
return clientFileDir;
}
@XmlElement
public String getServerFileDirectory() {
return serverFileDirectory;
}
@XmlElement
public int getPort() {
return port;
}
I hope this is something simple, been fondling with this all night(seriously)
Aucun commentaire:
Enregistrer un commentaire