This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

javax.crypto.Cipher.a (DashoA6275) noClassDefFoundError

 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!