Re: [Ikvm-developers] save Dom object as an xml file
Brought to you by:
jfrijters
From: Jeroen F. <je...@su...> - 2008-12-08 06:05:54
|
Hi, There are two main causes of NoClassDefFoundError: 1) When you compiled your code with ikvmc it gave a warning about a missing class. When this happens, ikvmc will insert code to throw a NoClassDefFoundError when that code path is executed. 2) A class initializer threw an exception (ExceptionInInitializerError) and you tried to access the class again. It would be helpful if you printed the full stack trace like this: catch (Exception e) { java.lang.Throwable.instancehelper_printStackTrace(ikvm.runtime.Util.mapException(x)); } If you're using C# 3.0 you can use the printStackTrace extension method: using ikvm.extensions; ... catch (System.Exception e) { e.printStackTrace(); } Regards, Jeroen > -----Original Message----- > From: Jyothi Koppisetti [mailto:jy...@di...] > Sent: Saturday, December 06, 2008 09:59 > To: ikv...@li... > Subject: [Ikvm-developers] save Dom object as an xml file > > > > Hi, > > I am using dll files of jar files to Communicating with JMS Q in Dot > net. I am using version ikvmbin-0.36.0.10-20080311A which was sent by > Jeroen Frijters [je...@su...] (in this Version solved the issue > related to multiple threads using JMS ) I tried to save Dom object in > an XML file using javax.xml.Transform namspace. It is throwing an > exception. I m getting exception type: java.lang.NoClassDefFoundError. > Message:org.apache.xml.serializer.OutputPropertiesFactory. > Please help me. > > Sequence of call stack is : > > > SportsBetting.exe!SportsBetting.JbossQ.printDocument(org.w3c.dom.Docume > nt document = {[#document: null]}, string path = "D:/sigonOn.xml") Line > 445 C# > > SportsBetting.exe!SportsBetting.CommOSS.SendMessageToCP(ref > org.w3c.dom.Document _doc = {[#document: null]}, string _stCommMsg = > "SignOn Request", long timeOut = 10000, int formID = 1, int > _MessageCode = 1) Line 202 + 0x10 bytes C# > > SportsBetting.exe!SportsBetting.CommOSS.SignOnToOSS(string operatorId = > "8001", string password = "1121") Line 73 + 0x1f bytes C# > > SportsBetting.exe!SportsBetting.Login.btnLogin_Click(object sender = > {Text = "Sing In"}, System.EventArgs e = {X = 38 Y = 13 Button = Left}) > Line 31 + 0x37 bytes C# > [External Code] > SportsBetting.exe!SportsBetting.Program.Main() Line 17 > + 0x1a bytes C# > [External Code] > > Method to save dom object as an xml file: > > > public static void printDocument(Document document, String path) > { > try { > // Prepare the DOM document for writing > Source source = new DOMSource(document); > Result result = null; > // Prepare the output file > try > { > FileOutputStream fout = new > FileOutputStream(path); > result = new StreamResult(fout); > } > catch (java.io.FileNotFoundException ex) > { > ex.printStackTrace(); > } > > // Write the DOM document to the file > Transformer xformer = > TransformerFactory.newInstance().newTransformer(); //Here I m > getting exception type: java.lang.NoClassDefFoundError. > Message:org.apache.xml.serializer.OutputPropertiesFactory > xformer.transform(source, result); > } > catch (TransformerConfigurationException e) > { > e.printStackTrace(); > } > catch (TransformerException e) > { > e.printStackTrace(); > } > catch (Exception e) > { > System.Console.WriteLine(e.Message.ToString()); > } > } > > > Regards, > Jyothi K. |