我在catch语句附近收到错误错误:需要java.lang.Throwabe找到org.springframework.oxm.XmlMappingException
enter code here public void writeObjectToXml(Object object, String filename) throws IOException {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(filename);
try {
marshaller.marshal(object, new StreamResult(fos));
} catch (XmlMappingException xme) {
}
fos.close();
} catch (Exception e) {
System.out.println("Error :: " + e);
}
}
答案 0 :(得分:0)
catch语句参数中不允许类型转换。