Posts Tagged ‘oc4j’

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

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

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 ...

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:

-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

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:

<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>

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. :-)