Solve the exception of org. xml. Sax. saxnotrecognizedexception (it is worth learning)

Source: Internet
Author: User
Tags xml parser

 

The following problems were encountered during project implementation:

Info: couldn't set dynamic validation feature org. xml. Sax. saxnotrecognizedexception: sax feature 'HTTP: // apache.org/xml/features/validation/dynamic' not recognized .......

After careful analysis, the cause of this error is that the XML parser in WebLogic 10.3 has a problem. In WebLogic Server 10.3, weblogic. jar META-INF/services/javax. XML. parsers. saxparserfactory specifies the default SAX Parser class, that is, weblogic. XML. JAXP. registrysaxparserfactory.

 

Decompiling the code of this class finds that this class inherits from saxparserfactory, but does not correctly override the related methods of its parent class, that is, the setxinludeaware () method in registrysaxparserfactory class should be setxincludeaware (), this should be a developer's spelling mistake, which is a WebLogic bug.

Public void setxinludeaware (Boolean paramboolean) <br/>{< br/> This. factoryproperties. Put (saxfactoryproperties. xincl, paramboolean); <br/> If (this. factory! = NULL) <br/> This. Factory. setxincludeaware (paramboolean); <br/>} 

 

The API of its parent class is used as evidence:

Setxincludeaware
Public void setxincludeaware (Boolean state)

Set the xinclude processing status.

If the xinclude mark is found in the document instance, it should be processed in the method specified in XML versions (xinclude) Version 1.0.

The default value of xinclude processing is false.

Parameter: State-set xinclude processing to true or false throw: unsupportedoperationexception-when this implementation does not override this method, it starts from the following versions: 1.5

 

 

Solution:

Edit setdomainenv. CMD/setdomainenv. SH and insert

. CMD: Set java_options = % java_options %-djavax. XML. parsers. saxparserfactory = com.sun.org. apache. xerces. internal. JAXP. saxparserfactoryimpl <br/>. SH: java_options = "$ {java_options}-djavax. XML. parsers. saxparserfactory = com.sun.org. apache. xerces. internal. JAXP. saxparserfactoryimpl "<br/> export java_options 

 

This article is transferred from Oracle Seeker: http://oracleseeker.com/2009/09/11/weblogic_sax_not_recognized/

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.