如何使用 Omnifaces 1.14.1修复 javax.xml.xpath.

我们有一个运行在 WAS 8.5 上的 JSF 2.0 Web 应用程序,我们在其中使用了 Omnifaces FullAjaxExceptionHandlerFactory。剩下的应用程序中没有使用 Omnifaces 的任何其他内容。UI 基于 Primefaces 框架。


应用程序正常启动但在某些操作(应用程序中的更改选项卡,按按钮)时发生以下异常:


000000d2 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet [FacesServlet] in application [<anonymized>]. Exception created : [java.lang.UnsupportedOperationException: java.lang.RuntimeException: javax.xml.xpath.XPathFactoryConfigurationException: Provider javax.xml.xpath.XPathFactory could not be instantiated: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: wsjar:file:/<anonymized>/lib/Saxon-HE-9.5.1-1.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax

    at org.omnifaces.config.WebXml.init(WebXml.java:186)

    at org.omnifaces.config.WebXml.init(WebXml.java:162)

    at org.omnifaces.config.WebXml.checkInitialized(WebXml.java:388)

    at org.omnifaces.config.WebXml.findErrorPageLocation(WebXml.java:208)

    at org.omnifaces.exceptionhandler.FullAjaxExceptionHandler.findErrorPageLocation(FullAjaxExceptionHandler.java:418)

    at org.omnifaces.exceptionhandler.FullAjaxExceptionHandler.handleAjaxException(FullAjaxExceptionHandler.java:350)

    at org.omnifaces.exceptionhandler.FullAjaxExceptionHandler.handle(FullAjaxExceptionHandler.java:322)

如果我注释掉 pom.xml 中的依赖项和 faces-config.xml 中的工厂。该应用程序工作正常。


这里是 faces-config.xml 中的条目


<factory>

    <exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory>

  </factory>

有什么想法,不兼容从何而来?


红糖糍粑
浏览 103回答 1
1回答

摇曳的蔷薇

有什么想法,不兼容从何而来?不兼容性来自项目中的依赖项:<dependency>&nbsp; &nbsp; <groupId>net.sf.saxon</groupId>&nbsp; &nbsp; <artifactId>Saxon-HE</artifactId>&nbsp; &nbsp; <version>9.5.1-1</version></dependency>Saxon-HE-9.5.1-1.jar 包含一个服务 /META-INF/services/javax.xml.xpath.XPathFactory,其中包含非法包含空格的行:net.sf.saxon.xpath.XPathFactoryImplhttp\://java.sun.com/jaxp/xpath/dom:&nbsp; &nbsp; net.sf.saxon.xpath.XPathFactoryImplhttp\://saxon.sf.net/jaxp/xpath/om:&nbsp; &nbsp; &nbsp;net.sf.saxon.xpath.XPathFactoryImpl这在javax.xml.xpath.ServiceLoader.parseLine方法中失败:....if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fail(service, u, lc, "Illegal configuration-file syntax");....尝试升级您的 Saxon-HE 版本,因为9.5.1-1 相当旧(2013 年)并且似乎与 Java 8+ 不兼容。版本 9.5.1-5 是第一个修复此错误的版本。The following bugs are cleared in 9.5.1.5, issued 2014-03-25...1944 Illegal configuration-file syntax in META-INF/services/javax.xml.xpath.XPathFactory1944年发行
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java