开发者

Spring oxm getting type cast error near catch statement

开发者 https://www.devze.com 2023-01-09 07:10 出处:网络
I am getting error near catch statement Error : required java.lang.Throwabe found org.springframework.oxm.XmlMappingException

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

精彩评论

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

关注公众号