aspose file tools*
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
JavaRanch » Java Forums » Engineering » Security
Bookmark "javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError" Watch "javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError" New topic
Author

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);
with

java.lang.NoClassDefFoundError
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:
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.sun.rsajca.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
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:

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.security.PrivilegedActionException: java.util.zip.ZipException:

Permission denied

at java.security.AccessController.doPrivileged(Native 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: http://aspose.com/file-tools
 
subject: javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError