本文介绍了java.lang.SecurityException:org.xml.sax.SAXNotRecognizedException:功能:http://apache.org/xml/features/allow-java-encodings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 Struts 编写的 tomcat Web 应用程序.它在带有 Tomcat 7Java 7 的 Linux 中运行良好.当我在 Tomcat8.5Java 8 下将它迁移到 Windows 10 时,
它抛出一个 SAXNOtREcognizedException 错误并且应用程序停止工作:

I have a tomcat web application written in Struts. It runs well in Linux with Tomcat 7 and Java 7. When I migrated it to Windows 10 under Tomcat8.5 and Java 8,
it throws a SAXNOtREcognizedException error and the application stops working:

java.lang.SecurityException:org.xml.sax.SAXNotRecognizedException:功能:http://apache.org/xml/features/allow-java-encodings

这些是包含在应用程序 WEB-INF/lib 文件夹下的 jar 文件:

These are the jar files included under the application WEB-INF/lib folder:

activation.jar
BCEL.jar
bsf.jar
collections.jar
commons-beanutils.jar
commons-collections.jar
commons-dbcp.jar
commons-digester.jar
commons-logging.jar
commons-pool.jar
commons-services.jar
commons-validator.jar
cos.jar
crimson.jar
DbConnectionBroker.jar
java_cup.jar
jaxp.jar
jdbc2_0-stdext.jar
jdom.jar
jdom-jdk11.jar
JLex.jar
log4j-1.2.7.jar
mailapi.jar
mysql_comp.jar
mysql.jar
ojdbc7.jar
regexp.jar
runtime.jar
smtp.jar
struts.jar
struts.jar--2
taglibs-request.jar
xalan.jar
xalansamples.jar
xalanservlet.jar
xercesImpl.jar
xerces.jar
xml-apis.jar
xsltc.jar

它们在 Linux 和 Windows 中具有相同的 jar 文件.

They have the same jar files in both Linux and Windows.

有人建议添加 bc4j-mbeans.jar,但我找不到在哪里下载它.我尝试下载 oc4j 容器,但是没有找到 bc4j-mbeans.jar.

Someone suggested to add the bc4j-mbeans.jar, but I could not find where to download it. I tried to download the oc4j container, but there is no bc4j-mbeans.jar found.

推荐答案

在 TOMCAT_HOME/conf/catalina.properties 中添加以下属性:

add the following properties to TOMCAT_HOME/conf/catalina.properties:

  • javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
  • javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
  • javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
  • javax.xml.datatype.DatatypeFactory=com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl

来源

这篇关于java.lang.SecurityException:org.xml.sax.SAXNotRecognizedException:功能:http://apache.org/xml/features/allow-java-encodings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 19:26