Metadata Aggregator - Issues with XMLSignatureSigningStage

Brent Putman putmanb at georgetown.edu
Sat Oct 22 19:52:36 BST 2011



On 10/22/11 2:24 PM, Dan McLaughlin wrote:
> Initialization of bean failed; nested exception is
> org.springframework.beans.ConversionNotSupportedException: Failed to
> convert property value of type 'java.lang.String' to required type
> 'java.security.PrivateKey' for property 'privateKey'; nested exception
> is java.lang.IllegalStateException: Cannot convert value of type
> [java.lang.String] to required type [java.security.PrivateKey] for
> property 'privateKey':


I haven't used it, but the error is pretty clear: you're trying to
inject a String where you need to inject a PrivateKey instance.


>     <bean id="signMetadata"
> class="net.shibboleth.metadata.dom.stage.XMLSignatureSigningStage">
>         <property name="id" value="signMetadata"/>
>         <property name="privateKey"
> value="/Users/Dan/workspace/metadata_aggregator/sp-key.pem"/>
>     </bean>
>


The error is here.  You can't inject the path to a PEM-encoded file
there, you need to inject the actual PrivateKey instance.

I know Chad has a Spring extension helper FactoryBean for that, perhaps
you should be using that to wire the PrivateKey key from a java.io.File
and then inject the bean ref to the PrivateKey.

http://svn.shibboleth.net/view/utilities/spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/factory/


More information about the dev mailing list