Hi Kilian,

Most likely it's picking up a mix of classes from xercesImpl.jar and the
version of Xerces in whatever JDK you're using which are incompatible with
each other. If you're using JDK 1.4 or above you should be using the
"Endorsed Standards Override Mechanism" [1][2]. If you merely put the jars
on the classpath you can end up with a hybrid mess where some of the API
and implementation get loaded from the JDK and other parts get loaded from
the jars.

Thanks.

[1] http://xerces.apache.org/xerces2-j/faq-general.html#faq-4
[2] http://java.sun.com/j2se/1.4.2/docs/guide/standards/

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

Kilian Evang <[EMAIL PROTECTED]> wrote on 08/28/2007 11:54:21 AM:

> Hi everybody,
>
> I'm new to Xerces. Today I added xercesImpl.jar and the other jars
> to my Eclipse build path to validate an XML document against an XML
> schema in my application. But when I call newSchema() on a Schema
> instance, I get:
>
> Exception in thread "main" java.lang.NoSuchMethodError: org.apache.
> xerces.impl.xs.XMLSchemaLoader: method
> loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V not found
>                 at org.apache.xerces.jaxp.validation.
> XMLSchemaFactory.newSchema(Unknown Source)
>                 at javax.xml.validation.SchemaFactory.
> newSchema(Unknown Source)
>                 at javax.xml.validation.SchemaFactory.
> newSchema(Unknown Source)
>                 at org.apache.uima.uima4jcr.
> RepositoryAnnotationService.<init>(RepositoryAnnotationService.java:80)
>                 at
org.apache.uima.uima4jcr.clt.JackHat.main(JackHat.java:80)
>
> Inspecting xercesImpl.jar, I find that the method it doesn't find is
> actually there in the XMLSchemaLoader class.
>
> Any ideas?
>
> Thanks
> - Kilian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to