incubator-odf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svante Schubert <svante.schub...@gmail.com>
Subject Re: Gettingjava.lang.NoClassDefFoundError: org/apache/clerezza/utils/UriException with Apache ODF Toolkit
Date Wed, 11 Sep 2013 16:08:43 GMT
Hi Ravi,

the list of all the dependent libs required is provided in the pom.xml
that can be found:
http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/pom.xml?view=markup
You will as well find all the dependent jars in your maven lib directory
".m2" after the first build.

The easiest thing to use the ODF Toolkit project, is to build the
project. The how to can be found
http://incubator.apache.org/odftoolkit/source.html and you will find a
JAR with all dependencies in the "target" subfolder, which is called
simple-odf-0.8.1-incubating-SNAPSHOT-jar-with-dependencies.jar
or for ODFDOM
odfdom-java-0.8.10-incubating-SNAPSHOT-jar-with-dependencies.jar

Hope that helps,
Svante

Am 09.08.2013 18:44, schrieb Ravi Joshi:
> 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
View raw message