-->
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.  [ 1 post ] 
Author Message
 Post subject: Jasypt 1.9.1 doesn't work with hibernate 4.3.4
PostPosted: Tue May 13, 2014 12:23 pm 
Newbie

Joined: Wed Mar 05, 2014 1:16 pm
Posts: 4
I used Jasypt to encrypt a pw and followed the instruction as below but I have a run time error of "java.lang.ClassNotFoundException: org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider". Did the new API and their implementation break Jasypt? Is there other way to do this? Thanks in advance.

My hibernate.cfg.xml:

<property name="hibernate.connection.encryptor_registered_name">configurationHibernateEncryptor </property>
<property name="hibernate.connection.algorithm">PBEWithMD5AndTripleDES</property>
<property name="hibernate.connection.password">ENC(E32KfS4Vgl4uCdFb1R3Eq3XQNsDkPyAkl)</property>

My code:

StandardPBEStringEncryptor myEncryptor = new StandardPBEStringEncryptor();
myEncryptor.setPassword("JDBC_PASSWORD");
myEncryptor.setAlgorithm("PBEWithMD5AndTripleDES");
myEncryptor.setKeyObtentionIterations(2000);
HibernatePBEEncryptorRegistry registry =
HibernatePBEEncryptorRegistry.getInstance();
registry.registerPBEStringEncryptor("configurationHibernateEncryptor", myEncryptor);

Configuration config = new Configuration();
URL url = DbManager.class.getClassLoader().getResource("db/hibernate.cfg.xml");

StandardServiceRegistryBuilder serviceBuilder = new StandardServiceRegistryBuilder();

serviceBuilder.applySettings(config.getProperties());
StandardServiceRegistry serviceReg = serviceBuilder.build();
sessionFactory = config.buildSessionFactory(serviceReg);


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.