Issue with SchemaFactory

989 views
Skip to first unread message

Alex Buloichik

unread,
Oct 19, 2013, 12:21:40 AM10/19/13
to jopend...@googlegroups.com
Hi !

Probably it's not an jOpenDocument's issue, but my configuration issue.

I just included jOpenDocument-1.3.jar into classpath, then try to work with xsd schemas:

SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

Exception is:

Exception in thread "main" java.lang.NoClassDefFoundError: org/iso_relax/verifier/VerifierConfigurationException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
    at java.lang.Class.getConstructor0(Class.java:2723)
    at java.lang.Class.newInstance0(Class.java:345)
    at java.lang.Class.newInstance(Class.java:327)
    at javax.xml.validation.SchemaFactoryFinder.loadFromService(SchemaFactoryFinder.java:446)
    at javax.xml.validation.SchemaFactoryFinder._newFactory(SchemaFactoryFinder.java:223)
    at javax.xml.validation.SchemaFactoryFinder.newFactory(SchemaFactoryFinder.java:144)
    at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:202)

WBR, Alex.

Florrie O.

unread,
Oct 19, 2013, 6:23:05 AM10/19/13
to jopend...@googlegroups.com
Hi Alex, did you try to install jaxb-libs-1.5.jar?
that should contain the class you don't have at the moment :)

Alex Buloichik

unread,
Oct 19, 2013, 7:27:58 AM10/19/13
to jopend...@googlegroups.com
Hi Florrie !

jaxb-libs-1.5.jar could be workaround only. JDK 7 includes JAXB 2.2.
I don't have real problem with that because I doesn't use jOpenDocument in the big system yet. But it will be good to fix it.

WBR, Alex.

Sylvain Cuaz

unread,
Oct 21, 2013, 8:57:53 AM10/21/13
to jopend...@googlegroups.com
Le 19/10/2013 06:21, Alex Buloichik a �crit :
> Hi !
>
> Probably it's not an jOpenDocument's issue, but my configuration issue.
>
> I just included jOpenDocument-1.3.jar into classpath, then try to work with
> xsd schemas:
>
> SchemaFactory factory =
> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
>
> Exception is:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/iso_relax/verifier/VerifierConfigurationException

It is indeed specified by jOpenDocument : META-INF/services/javax.xml.validation.SchemaFactory
contains org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl which needs
VerifierConfigurationException. To solve this you could either
1. as specified in the README add msv.jar, relaxngDatatype.jar, xsdlib.jar and isorelax.jar from
http://java.net/downloads/msv/releases/msv.20090415.zip which would allow you to use
ODPackage.validateSubDocuments()
2. define the system property "javax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0"
3. remove the javax.xml.validation.SchemaFactory file from the jar

Cheers,
Sylvain

Reply all
Reply to author
Forward
0 new messages