3 Replies Latest reply on Mar 19, 2008 2:12 PM by Casey Boyd

    Seam Pros: Need help with jasypt

    Casey Boyd Newbie

      I followed these steps...


      http://www.jasypt.org/seam2.html


      I get the field in the database encrypted....and it works great...


      The problem is when I try to retrieve the field, I get some jasypt excpetion...


      Is there something I am doing wrong?


      Thanks


      indy

        • 1. Re: Seam Pros: Need help with jasypt
          Keith Naas Novice

          Not sure if you are or aren't.  Can you provide the exception details including the stack trace so we can see what is happening?


          Thanks,

          • 2. Re: Seam Pros: Need help with jasypt
            Casey Boyd Newbie

            my bean:


            @TypeDef(
                 
                 name="encryptedString",
                 typeClass=EncryptedStringType.class,
                 parameters= {@Parameter(name="encryptorRegisteredName", value="myHibernateStringEncryptor")}
            ) 
                 
            @Entity
            @Name("question")
            @Table(name="QUESTION")
            public class Question implements Serializable{
                    
                    private String question;
            
                 @NotNull(message = "Question is required")
                 @Column(length=1000)
                 @Type(type="encryptedString")
                 public String getQuestion() { return this.question; }
                 public void setQuestion(String question) { this.question = question; }
            
            }



            Error:


            org.jasypt.exceptions.EncryptionOperationNotPossibleException


            Thats it....


            I get this only when trying to retrieve and display the question attribute...


            I can create a new record and encrypt the field just fine...


            It looks like my problem is in the decryption...


            thanks


            indy



            • 3. Re: Seam Pros: Need help with jasypt
              Casey Boyd Newbie

              Found the problem...


              I had records in the database that didn't have the question (encrypted field) encrypted.


              When it tried to pull back these records, I got the error...


              Everything works great now...