首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring SAML + Wildfly 8+ IBM Jdk (1.7) - java.lang.RuntimeException: org.w3c.dom.ls.LSException:[ERR 0462]遇到不支持的编码

Spring SAML + Wildfly 8+ IBM Jdk (1.7) - java.lang.RuntimeException: org.w3c.dom.ls.LSException:[ERR 0462]遇到不支持的编码
EN

Stack Overflow用户
提问于 2016-03-02 13:03:22
回答 1查看 357关注 0票数 0

在Wildfly 8和IBM JDK 1.7中部署spring-saml应用程序时,我遇到了一个错误。有趣的是,谷歌没有给我答案。

错误堆栈跟踪是

代码语言:javascript
复制
Caused by: org.w3c.dom.ls.LSException: [ERR 0462] An unsupported encoding is encountered.
at org.apache.xml.serializer.dom3.LSSerializerImpl.write(Unknown Source) [xml.jar:]
at org.opensaml.xml.util.XMLHelper.writeNode(XMLHelper.java:892)
at org.opensaml.xml.util.XMLHelper.writeNode(XMLHelper.java:872)
at org.opensaml.xml.util.XMLHelper.nodeToString(XMLHelper.java:834)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:159)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:143)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:203)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:186)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:92)
at org.opensaml.PaosBootstrap.bootstrap(PaosBootstrap.java:27)
at org.springframework.security.saml.SAMLBootstrap.postProcessBeanFactory(SAMLBootstrap.java:42)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:696)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:461)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:194)

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2016-06-23 15:03:30

我认为问题出在serializer.jar.和opensaml.jar之间的依赖关系当您使用Spring Security SAML插件时,您可能会使用以下库(与演示应用程序中的库相同):

  • opensaml-2.6.1.jar
  • spring-security-config-3.1.2.jar
  • spring-security-core-3.2.1.jar
  • spring-security-web-3.2.1.jar
  • spring-security-saml2-core-1.0.2.jar

Wildfly 8 (和9 )都带有serializer-2.7.1.jbossorg-1.jar (/modules/system/layers/base/org/apache/xalan/main),这似乎与“标准”serializer-2.7.1.jar (https://mvnrepository.com/artifact/xalan/serializer/2.7.1)有一些不同。

我比较了这两个jars,它们包含相同的类和资源,但是它们的大小不同。“标准”文件是使用带有Oracle JDK 1.6_20的IBM 1.3.1 JBoss版本编译的-这是基于这两个MANIFEST.MF文件的。注opensaml.jar是用基于Maven库信息的“标准”序列化器库编译的。

我在搜索“标准”serializer-2.7.1.jar的源代码,但没有找到。然而,我发现了另一个2.7.1版本,这一次是来自Spring,并与一个JBoss源代码进行了比较,它们有一些差异。我假设如果我比较“标准”源代码,我会发现相同的。这不是我之前看到的简单的文件重命名。

我做的下一件事是一些实验。首先,将serializer-2.7.1.jar放到我的application.war/WEB-INF/lib,中,启动Wildfly (v8.2.1),应用程序启动时没有任何问题。删除了JAR并返回到异常。

接下来,我使用serializer-2.7.1.jar代替serializer-2.7.1.jbossorg-1.jar更改了WF的xalan模块(删除了jar文件并编辑了module.xml)。启动了WF,令人惊讶的是,我得到了同样的异常。我甚至尝试过更改为serializer-2.7.1.jbossorg-2.jar (与Wildfly 10打包在一起)和serializer-2.7.2.jar (https://mvnrepository.com/artifact/xalan/serializer/2.7.2),但仍然出现异常。

最后,我将模块更改回滚到原始状态,并在应用程序“jboss-deployment-structure.xml”.中创建了包含-2.7.1.jar的序列化自定义WF模块,并添加了模块依赖项

is 8.5.5is Liberty Profile 8.5.5下,突出显示应用程序启动时没有任何问题(或其他serializer.jar)是很重要的。(将生产作为目标,另一个开发作为目标)。Wildfly中的自定义模块非常方便,可以避免在这种情况下修改应用程序。

另外,作为解决这个问题的测试的一部分,我升级到了最新的Spring-Security (3.2.9)Open-SAML (2.6.4),并且我需要升级到serialize.jar到2.7.2

另外,我和Mahe在同一个项目中工作过,但他几个月前离开了,我得到了解决这个问题的任务。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35738888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档