It's all connected

Somehow

Could Not Initialize Class javax.crypto.SunJCE_b

Today when deploying a new version of a webapplication to Tomcat I got the following error:

Could not initialize class javax.crypto.SunJCE_b

Since I had just upgraded Java, I started looking there. After a lot of digging around, including changing from Suns java to Openjdk (this was on Centos 5.2) I got this error:

    java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.DefaultSSLContextImpl)

After some digging around I found two things that were wrong:

a) I am quite sure that the /usr/lib/jvm/jre-openjdk/lib/security/cacerts file should be larger than 32 bytes.

b) The main problem was that I had set the CLASSPATH all wrong.

Morals? No morals, just check those two if you ever get this error.

Comments