Jasypt Users Forum

org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jasypt.encryption.pbe.StandardPBEStringEncryptor]

by palaniappan :: Rate this Message:

Reply to Author | View in Thread

Hi,
      I am getting the following error when i am using the jasypt1.5

   DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Ignoring constructor
        [public org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer(org.jasypt.util.text.TextEncryptor)]
        of bean 'propertyConfigurer': could not satisfy dependencies
       
        org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jasypt.encryption.pbe.StandardPBEStringEncryptor]
        to required type [org.jasypt.util.text.TextEncryptor]
        at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1015)
        at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:892)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:495)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:306)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)


  I am using jasyspt 1.5 , hibernate 2.0  and spring 1.1.4 in my application.
 Could you please help me to solve this problem?.

Please find the bean configurations. I have set my encryption password in environment variable and have the user name and password in  application.properties file.

 <bean id="environmentVariablesConfiguration"
     class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
   <property name="algorithm"><value>PBEWithMD5AndDES</value></property>
   <property name="passwordEnvName"><value>APP_ENCRYPTION_PASSWORD</value></property>
 </bean>

 <bean id="configurationEncryptor"
  class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
   <property name="config"><ref bean="environmentVariablesConfiguration"/></property>
 </bean>

 
<bean id="propertyConfigurer"
      class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
   <constructor-arg index="0"><ref bean="configurationEncryptor"/></constructor-arg>
   <property name="locations">
     <list>
       <value>/WEB-INF/classes/application.properties</value>
     </list>
   </property>
 </bean>


  Any help would be appreciated.

 Regards,
 Thiru