-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: getting error on No string encryptor registered for hiberna
PostPosted: Thu Feb 19, 2015 3:22 am 
Newbie

Joined: Thu Feb 19, 2015 2:44 am
Posts: 2
Hi
Am using hibernate3 and struts frame. hibernate annotation am using. in my project required password encryptio required for that we used jasypt. as per their website instruction followed but getting like

org.jasypt.exceptions.EncryptionInitializationException: No string encryptor registered for hibernate with name "strongHibernateEncryptor"


My hibernate.cfg.xml code
<property name="connection.provider_class">org.jasypt.hibernate3.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider </property>

<property name="connection.encryptor_registered_name">strongHibernateEncryptor</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5433/postgres</property>
<property name="hibernate.connection.username">admin</property>
<property name="connection.password">admin</property>


My Domain class is
@Entity
@Table(name = "USERS")
@TypeDef (
name="encryptedString",
typeClass=EncryptedStringType.class,
parameters= {
@Parameter
(name="encryptorRegisteredName", value="strongHibernateEncryptor") } )



@Column(name = "USERS_PASSWORD", nullable = false, length = 12)
@Type(type="encryptedString")
public String getPassword() throws Exception {

return password;
}

public void setPassword(String password) throws Exception {

System.out.println("password set method password: "+password);
//String s = strongEncryptor.setPassword(password);
StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
strongEncryptor.setAlgorithm("PBEWithMD5AndTripleDES");
strongEncryptor.setPassword(password);
HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();
registry.registerPBEStringEncryptor("strongHibernateEncryptor", strongEncryptor);
//registry.registerPBEStringEncryptor("strongHibernateStringEncryptor", strongEncryptor);
strongEncryptor.setPassword(password);
//String s = (strongEncryptor.setPassword(password));
this.password = password;
System.out.println("password set method password: "+password);
}


please help me to solve this issue


Top
 Profile  
 
 Post subject: Re: getting error on No string encryptor registered for hiberna
PostPosted: Fri Feb 20, 2015 1:28 am 
Newbie

Joined: Thu Feb 19, 2015 2:44 am
Posts: 2
Please urgent anyone can help me.....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.