Solved: Digester.getParser: org.xml.sax. SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic

By | June 3, 2009

I ran into a nice little problem trying to get richfaces deployed on Oracle’s OC4J:

[text]
Digester.getParser:
org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
… snip …
[/text]

From a little bit of googling, I found several people running into this problem or something very similar. Frustratingly, not a whole lot of solutions. One solution that did not work (but was confirmed by some to do the trick) was to run the OC4J standalone server with the following parameters:

[text]
-Dbootclasspath:/somepath/xerces-2.6.2.jar
-Dorg.xml.sax.drive­r=org.apache.xerces.­parsers.SAXParser
-Djavax.xml.parsers­.SAXParserFactory=or­g.apache.xerces.jaxp­.SAXParserFactoryImp­l
-Djavax.xml.parsers­.TransformerFactory=­org.apache.xalan.pro­cessor.TransformerFa­ctoryImpl
-Djavax.xml.transfo­rm.TransformerFactor­y=org.apache.xalan.p­rocessor.Transformer­FactoryImpl
[/text]

Luckily a co-worker (who is waaaaaaay to humble for his own good and won’t let me use his name here) figured out that adding the following to orion-application.xml does the trick:

[xml]
<orion-application>

<imported-shared-libraries>
<remove-inherited name="oracle.xml"/>
<remove-inherited name="oracle.xml.security"/>
<remove-inherited name="oracle.toplink"/>
</imported-shared-libraries>

</orion-application>
[/xml]

Oracle has details on what the above does in their documentation on utilizing the OC4J class loading framework. Good luck reading that, it looks terribly boring. :-)

Leave a Reply

Your email address will not be published. Required fields are marked *