【发布时间】:2021-11-09 13:52:06
【问题描述】:
我在 opensaml2.6 上运行此代码
Element metadataRoot = document.getDocumentElement();
// Unmarshall
UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(metadataRoot);
if (unmarshaller == null) {
System.out.println("Error receiving unmarshaller for this document.");
return;
}
对于文档
<?xml version="1.0" encoding="UTF-8"?><saml2:EncryptedAssertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
Unmarshaller 返回一个null,你能帮我理解一下查找正确Unmarshaller 的标准是什么以及它在opensaml 中的工作原理吗?
【问题讨论】:
-
我发现没有unmarshallers register 因为库中没有初始化: 重要的一段代码: // 初始化库 DefaultBootstrap.bootstrap();
标签: java nullpointerexception null marshalling opensaml