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 Brian White <bw...@steptwo.com.au> on 2002/02/01 06:08:17 UTC
InstantiationError for DOMException in xerces 1.4.4 under
tomcat
This is my first post to this list, so please pardon any faux pas.
I have done my best to find this elsewhere but I have had no luck.
I have a method on a factory class that I use to create a DOM Document
of type "DocumentImpl". As part of that method I set it to be
readonly on a deep level.
DocumentImpl domdoc = (DocumentImpl)parser.getDocument();
domdoc.setReadOnly( true, true );
return domdoc;
I use this in a servlet. In the servlet I attempt to set an attribute
on the root element of the DOM document. This, of course, raises
an exception. The problem is that it is the wrong exception!
What I get is:
java.lang.InstantiationError: org.w3c.dom.DOMException
at org.apache.xerces.dom.ElementImpl.setAttribute(ElementImpl.java:441)
at
com.steptwo.intranet.servlets.XMLParserTestNew.doGet(XMLParserTestNew.java:207)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
...
Where lines 438 to 443 of ElementImpl.java are:
public void setAttribute(String name, String value) {
if (ownerDocument.errorChecking && isReadOnly()) {
throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
"DOM001 Modification not allowed");
}
I can see no reason for this. DOMException is neither abstract
nor an interface, and I even recompiled DOMException.java file and
copied it into the tomcat classes area. ( Note that I am not a
complete java novice but I am definitely a tomcat novice so
there may well some foible of that that I am unaware of )
Please Help! I am very puzzled.
Regs
Brian White
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901
Web: http://www.steptwo.com.au/
Email: bwhite@steptwo.com.au
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org