2010-07-30 19 views
0

我越來越近catch語句錯誤錯誤:需要java.lang.Throwabe發現org.springframework.oxm.XmlMappingException春季OXM得到類型轉換錯誤

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

類型轉換是不允許在catch語句論據。