The OpenDocument XML.org web site is not longer accepting new posts. Information on this page is preserved for legacy purposes only. For current information on ODF, please see the OASIS OpenDocument Technical Committee.

Follow-up ODFDOM tutorial

Sorry, newbie here trying to do tutorial mentioned at: http://opendocument.xml.org/news/odfdom-tutorial

import statements on .jar files apparently not working...

when attempt to run from currrent directory:

%java QuickOdt

Exception in thread "main" java.lang.NoClassDefFoundError: org/odftoolkit/odfdom/doc/OdfTextDocument at QuickOdt.main(QuickOdt.java:38) Caused by: java.lang.ClassNotFoundException: org.odftoolkit.odfdom.doc.OdfTextDocument at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more

not sure if I missed something or if the JVM is having some issue with my system? Vista Home Premium.

renamed .jar file to .zip and the structure is fine org\odftoolkit\odfdom\doc\OdfTextDocument.class does exist ... wouldn't think front/back slash matters?

I just recompiled the QuickODT program with the latest version of odfdom.jar (2010-02-19), and it appears to work. Could this be a classpath problem? If you don't have Xerces and ODFDOM in your default classpath, you will need to specify them when you run the program as well. On my Linux machine, the command was

java -cp lib/xercesImpl.jar:lib/odfdom.jar:. QuickOdt

 

Hi Jaocon,

you are right, the tutorials are not reflecting the latest API changes, as the ODFDOM team member with the focus on tutorials is currently distracted by his main profession.

Therefore until we have closed the gap, please take a look at the descriptions referenced from our project home page:

http://odftoolkit.org/projects/odfdom/pages/Home

Thanks for bringing this up,
Svante

XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I