2016-11-09 89 views
0

你好我目前移植一個應用程序來opensaml3碰上了以下問題:OpenSAML 3解組爲空

InitializationService.initialize(); 
... 
Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(qName); 

我從opensaml2取代DefaultBootstrap和初始化函數前面。工廠仍然將我作爲編組返回給我。 有什麼想法這裏出了什麼問題?

這是初始化進度輸出:

[main] INFO org.opensaml.core.config.InitializationService - Initializing OpenSAML using the Java Services API 
[main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmlenc#ripemd160 
[main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160 
[main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160 

回答

1

我supose你使用opensaml V3 所以你應該創建一個XMLObjectProviderRegistrySupport類UnmarshallerFactory對象這樣它完美

UnmarshallerFactory umFactory=XMLObjectProviderRegistrySupport.getUnmarshallerFactory(); 
    Unmarshaller unmarshaller=umFactory.getUnmarshaller(element);