2015-04-06 21:19 GMT+03:00 Prathyusha Kanala <knprathyu...@gmail.com>:
> Hi,
>
> My web application was initially running on tomcat 7.0.53 and I
> use org.apache.commons.codec.binary.Base64 for encryption and decryption.
>
> Now the server has been updated to tomcat 7.0.57 and I get a java
> Nullpointer error at c.doFinal line:
>
>     public static String make(String Data) throws Exception {
>     byte[] encodedCommons;
>         Key key = generateMakeKey();
>         Cipher c = Cipher.getInstance(ALGO);
>         c.init(Cipher.ENCRYPT_MODE, key);
>        * byte[] encVal = c.doFinal(Data.getBytes());*
>         encodedCommons = Base64.encodeBase64(encVal);
>         String encryptedValue = new String(encodedCommons);
>         //BASE64Encoder benc = new BASE64Encoder();
>         //String encryptedValue = benc.encode(encVal);
>         return encryptedValue;
>     }
>
> Is the problem because I need to be using something other than the
> org.apache.commons.codec.binary.Base64?


Unlikely.

Run it with a debugger.  (Debugging Tomcat is described in Wiki / FAQ).

It is likely that your "Data" parameter has null value.

What is the reason for that null value cannot be said with that little
information that you provided. You have to figure that out by
yourself.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to