File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError" Watch "javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError" New topic

javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError

Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

We are using the code below to encrypt a short string of data. It works fine in our desktop weblogic server environments, but fails on the server. It fails on the line Cipher cipher = Cipher.getInstance("AES",p);

at javax.crypto.Cipher.a(DashoA6275)
at javax.crypto.Cipher.getInstance(DashoA6275)

notes about the server environment:
It is weblogic portal 8.1.5
ssl is enabled
the security providers look like this:
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

We found the issue.
It turns out that the server admin, when adding the unlimited security jar files to jre/lib/security forgot to change the permissions and left them as only reachable by root.

The first user to attempt the action that relies on crypto got a long error with this at the bottom:

Caused by:

Permission denied

at Method)

subsequent visitors got a different error, the one I pasted in my first post, and it contained no information about PrivilegedActionException

It was only when we deployed our app on a different box that we had a look at the first error.

Apparently java ate the error on subsequent visits because of some reason that I don't fully understand.

This teaches two lessons.
1) read the entire stack trace of errors and read them again.
2)Java can eat errors in ways I might not expect

here is the full stack trace of the first time error:
I agree. Here's the link:
subject: javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError
It's not a secret anymore!