You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Sudhindra Deshpande <d_...@hotmail.com> on 2001/04/06 21:13:51 UTC
Help: schema validation : NoSuchMethodError: org.w3c.dom.Document: method createElementNS
Hi,
I tried to set schema validation like this
class try1 {
public static void main(String[] args) {
org.apache.xerces.parsers.DOMParser parser;
org.w3c.dom.Element ele;
try {
parser = new org.apache.xerces.parsers.DOMParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", t
rue);
parser.parse(args[0]);
ele = parser.getDocument().getDocumentElement();
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
}
But I get this exception
Exception in thread "main" java.lang.NoSuchMethodError:
org.w3c.dom.Document: me
thod
createElementNS(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
not found
at org.apache.xerces.parsers.DOMParser.startElement(DOMParser.java,
Comp
iled Code)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java, Compiled Code)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
at
org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar
(XMLValidator.java:2663)
at
org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElem
entAndAttributes(XMLValidator.java, Compiled Code)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java, Compiled Code)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java, Compiled Code)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:993)
at try1.main(try1.java:9)
thanks in advance
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Help: schema validation : NoSuchMethodError: org.w3c.dom.Document: method createElementNS
Posted by Sudhindra Deshpande <d_...@hotmail.com>.
Ian,
I was using jdk 1.2.2 , after seeing a message from Bjoern , I used jdk 1.3
and now it works fine.
I dont know why. My classpath is set to . and xerces.jar ( 1.3.1 ) on NT 4.0
SP6
Thanks
-sudhin
----- Original Message -----
From: "Ian Roberts" <ir...@decisionsoft.com>
To: <xe...@xml.apache.org>
Sent: Saturday, April 07, 2001 3:37 AM
Subject: Re: Help: schema validation : NoSuchMethodError:
org.w3c.dom.Document: method createElementNS
> On Fri, 6 Apr 2001, Sudhindra Deshpande wrote:
>
> > But I get this exception
> >
> > Exception in thread "main" java.lang.NoSuchMethodError:
> > org.w3c.dom.Document: me
> > thod
> >
createElementNS(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
> > not found
> > org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
>
> It looks like you have another jar file, other than xerces, in your
> classpath which provides the org.w3c.dom interfaces. If that is DOM level
> 1 only, then it won't have the namespaced methods xerces uses. If you
> make sure xerces.jar is the first thing in your classpath, everything
> should work fine.
>
> Ian
>
> --
> Ian Roberts | ian@roberts.net (home)
> DecisionSoft Ltd. | irr@decisionsoft.com (work)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Help: schema validation : NoSuchMethodError: org.w3c.dom.Document:
method createElementNS
Posted by Ian Roberts <ir...@decisionsoft.com>.
On Fri, 6 Apr 2001, Sudhindra Deshpande wrote:
> But I get this exception
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.w3c.dom.Document: me
> thod
> createElementNS(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
> not found
> org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
It looks like you have another jar file, other than xerces, in your
classpath which provides the org.w3c.dom interfaces. If that is DOM level
1 only, then it won't have the namespaced methods xerces uses. If you
make sure xerces.jar is the first thing in your classpath, everything
should work fine.
Ian
--
Ian Roberts | ian@roberts.net (home)
DecisionSoft Ltd. | irr@decisionsoft.com (work)
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org