incubator-odf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi Joshi <ravi.josh...@yahoo.com>
Subject Gettingjava.lang.NoClassDefFoundError: org/apache/clerezza/utils/UriException with Apache ODF Toolkit
Date Fri, 09 Aug 2013 16:44:50 GMT
Hi,

I am trying to read an ods file using Apache ODF Toolkit. I am getting java.lang.NoClassDefFoundError
error while while trying execute the code provided here http://incubator.apache.org/odftoolkit/simple/demo/demo6.html

I done debugging the code and found that below line is causing the error-

SpreadsheetDocumentdata =SpreadsheetDocument.loadDocument(file);

Below is the error trace-
Exceptionin thread "main"java.lang.NoClassDefFoundError:org/apache/xerces/dom/ElementNSImplat
java.lang.ClassLoader.defineClass1(NativeMethod)at java.lang.ClassLoader.defineClassCond(UnknownSource)at
java.lang.ClassLoader.defineClass(UnknownSource)at java.security.SecureClassLoader.defineClass(UnknownSource)at
java.net.URLClassLoader.defineClass(UnknownSource)at java.net.URLClassLoader.access$000(UnknownSource)at
java.net.URLClassLoader$1.run(UnknownSource)at java.security.AccessController.doPrivileged(NativeMethod)at
java.net.URLClassLoader.findClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)at
sun.misc.Launcher$AppClassLoader.loadClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)at
java.lang.ClassLoader.defineClass1(NativeMethod)at java.lang.ClassLoader.defineClassCond(UnknownSource)at
java.lang.ClassLoader.defineClass(UnknownSource)at java.security.SecureClassLoader.defineClass(UnknownSource)at
 java.net.URLClassLoader.defineClass(UnknownSource)at java.net.URLClassLoader.access$000(UnknownSource)at
java.net.URLClassLoader$1.run(UnknownSource)at java.security.AccessController.doPrivileged(NativeMethod)at
java.net.URLClassLoader.findClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)at
sun.misc.Launcher$AppClassLoader.loadClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)at
test.read.ODSFile.ReadODS.main(ReadODS.java:33)Causedby:java.lang.ClassNotFoundException:org.apache.xerces.dom.ElementNSImplat
java.net.URLClassLoader$1.run(UnknownSource)at java.security.AccessController.doPrivileged(NativeMethod)at
java.net.URLClassLoader.findClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)at
sun.misc.Launcher$AppClassLoader.loadClass(UnknownSource)at java.lang.ClassLoader.loadClass(UnknownSource)...25more

odfdom-java-0.8.9-incubating.jar and simple-odf-0.8-incubating.jar are in classpath. Later
on from here http://incubator.apache.org/odftoolkit/simple/gettingstartguide.html I added
Apache Xerces 2.11 to the classpath also. Still facing the problem. Below is the error trace-

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/clerezza/utils/UriException
at org.odftoolkit.odfdom.pkg.OdfPackage.getBaseURLFromFile(OdfPackage.java:2226) at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:320)
at org.odftoolkit.simple.Document.loadDocument(Document.java:328) at org.odftoolkit.simple.SpreadsheetDocument.loadDocument(SpreadsheetDocument.java:205)
at test.read.ODSFile.ReadODS.main(ReadODS.java:33)
Caused by: java.lang.ClassNotFoundException: org.apache.clerezza.utils.UriException at java.net.URLClassLoader$1.run(Unknown
Source) 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) ... 5 more

I am now ended up with adding dependencies. My objective is just to read some cells from an
ods file. Can anybody please provide the list of all the jars needed just to read ods file? 

 


-Ravi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message