开发者

Spring oxm getting type cast error near catch statement

I am getting error near catch statement Error : required java.lang.Throwabe found org.springframework.oxm.XmlMappingException

enter code here public void writeObjectToXml(Object object, String filename) throws IOException {
    FileOutputStream fos = null;
    try {
        fos = new FileOutputStream(filename);
     开发者_StackOverflow   try {
            marshaller.marshal(object, new StreamResult(fos));
        } catch (XmlMappingException xme) {
        }
        fos.close();
    } catch (Exception e) {
        System.out.println("Error :: " + e);
    }
}


Type casting is not allowed in catch statement argument.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜