I work with Xerces-for-Android: https://code.google.com/p/xerces-for-android/
If I copy the source code into a simple test project (a java project, not an android project), I can run the xml validation tests without any problems.
When I make a jar from the source files, use it in my class path instead of the source, I get a NoClassDefFoundError , despite the fact that the files are present in the jar.
The following is the error message:
java.lang.ExceptionInInitializerError at mf.org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source) at mf.org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source) at mf.org.apache.xerces.impl.xs.XMLSchemaLoader.reset(Unknown Source) at mf.org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) at mf.org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) at mf.org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source) at mf.javax.xml.validation.SchemaFactory.newSchema(Unknown Source) at xml.MFXMLUtil.validate(MFXMLUtil.java:33) at xml.MFXMLTester.main(MFXMLTester.java:8) Caused by: java.lang.RuntimeException: internal error at mf.org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown Source) at mf.org.apache.xerces.impl.dv.xs.BaseSchemaDVFactory.createBuiltInTypes(Unknown Source) at mf.org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown Source) at mf.org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown Source) ... 9 more
Below is my ant script to make a jar:
<project name="XercesForAndroid" default="dist" basedir="."> <description> Builds jar for Xerces-For-Android </description> <property name="src" location="src"/> <property name="build" location="build"/> <property name="dist" location="dist"/> <target name="init"> <mkdir dir="${build}"/> </target> <target name="compile" depends="clean, init" description="compile the source " > <javac verbose="true" target="1.6" srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depends="compile" description="generate the distribution" > <mkdir dir="${dist}/lib"/> <jar jarfile="${dist}/lib/Xerces-For-Android.jar" basedir="${build}"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> <delete dir="${dist}"/> </target> </project>
Class files exist in the bank. Do I need to do anything special in the manifest, or am I missing something obvious?
source share