[jdom-interest] SAXBuilder.createParser() cannot load Piccolo

Laurent Bihanic laurent.bihanic at atosorigin.com
Tue Mar 4 08:54:02 PST 2003


Martin Schulz wrote:
> A while ago I came across a problem with setting up the Piccolo SAX
> parser as the SAX parser of choice, when JDOM produced an Exception in
> the reflection code in createParser:
> java.lang.IllegalAccessException: Class org.jdom.input.SAXBuilder can
> not access a member of class
> com.bluecast.xml.JAXPSAXParserFactory$JAXPSAXParser with modifiers
> "public"

This is a known Java reflection issue when dealing with inner classes 
implementing interfaces. It can be worked around by invoking setAccessible on 
the method object:

          try {
             getXMLReader.setAccessible(true);
          }
          catch (SecurityException ex2) { /* Ignore and try anyway! */ }

Laurent




More information about the jdom-interest mailing list