It appears that because the commons version of Digester requires JAXP1.1 and
is implemented by extending DefaultHandler rather than HandlerBase, Struts
1.1 doesn't work in Weblogic 6.0 without some pain.
Weblogic 6.0 has what's called an XML Registry which allows you to use
different parsers for different xml doc types. You can change the default
parser to be a newer parser than the one that ships with 6.0 but you still
have to go through the Weblogic XML Registry because when Weblogic starts up
it calls:
System.setProperty("javax.xml.parsers.SAXParserFactory",
"weblogic.xml.jaxp.RegistrySAXParserFactory");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"weblogic.xml.jaxp.RegistryDocumentBuilderFactory");
That overrides trying to change the parser factory on the command line when
starting up weblogic. The problem arises because somewhere along the line
Weblogic extends SAXParser which has new new methods in JAXP 1.1. The
weblogic extension of SAXParser doesn't have these methods implemented so
you get a runtime NoSuchMethodError or AbstractMethodError exceptions
depending on your setup.
The only way I have found to get around this so that struts-config.xml can
be processed is to call:
System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
in the init() method of a sub-classed ActionServlet.
This is probably a bad idea because it affects the entire application server
and not just one particular webapp. It also means that a Struts 1.1
application won't work on Weblogic 6.0 without modifications.
It's too bad there isn't a release of Digester in commons that works with
JAXP1.0. That would allow application servers that don't support JAXP1.1 to
use Struts 1.1 by using an older release of Digester. Was there any
compelling reason to change Digester from JAXP 1.0 to 1.1?
If anyone has found an easier way to get Weblogic 6.0 and Struts 1.1 to work
nicely together, let me know.
Thanks, Hal