--- Simeon Fitch <[EMAIL PROTECTED]> wrote: > > I just tried it out under Java 1.3 instead of Java > 1.2, and I'm getting an IllegalAccessException when > loading a file, that I didn't get under Java 1.2
I think I know the problem, and it is really nasty. It's also probably my own punishment for trying to leverage the Sun specific DOM building code rather than writing my own. (I want a DOM builder that allows me to register which classes get instantiated for each element type, which the Sun implementation allows, but the generic javax.xml.parser and org.w3c.dom stuff doesn't, as far as I can tell.) The root of the problem (if you can call it that) is that Java 1.3 does much more rigorous, or at least different, checking of access permissions. I'm extending a class called com.sun.xml.tree.ElementNode, which extends the package private class com.sun.xml.tree.ParentNode. ParentNode implements org.w3c.dom.Node, org.w3c.dom.NodeList, and some other things. My code calls the method org.w3c.dom.NodeList.getLength(), which is implemented in the package private ParentNode class, where Java 1.3 is barfing. So even though NodeList is public and ElementNode is public, the fact that ParentNode is package private and I'm calling it's implementation of the NodeList.getLength() method causes the IllegalAccessException to be thrown. Incidentally, the ParentNode.getLength() method is declared final, so I can't reimplement it. This is a big bummer for me because I was getting a lot of functionality for free. Unless others know of a better way, for me to get a org.w3c.dom.Document version of the build.xml file, where my own classes are members of the tree, I'm going to have to implement my own DOM builder using the SAX API, (just like Ant does). I'm not sure the JAXP 1.0.1 API exposes the amount of API I need to do this in library inspecific manner. FYI: One of the reasons I want a true w3c dom representation of the build file is so that I can preserve the input content faithfully, including comments, etc. so when it is saved you are faithful to the original version. So, I'll see if I can get a quick fix in place in the short term, but regardless of what I do it will probably still be a useless tool for a while. sim ===== Mustard Seed Software mailto:[EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/
