—
Edit: this should have been fixed by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634058
—
I came across this error the other day running a java application on Debian Wheezy:
java.security.ProviderException: Could not initialize NSS
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:201)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:262)
at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:244)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:244)
at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:224)
at sun.security.jca.ProviderList.getProvider(ProviderList.java:232)
at sun.security.jca.ProviderList.getIndex(ProviderList.java:262)
at sun.security.jca.ProviderList.getProviderConfig(ProviderList.java:246)
at sun.security.jca.ProviderList.getProvider(ProviderList.java:252)
at java.security.Security.getProvider(Security.java:473)
at jd.http.XTrustProvider.install(XTrustProvider.java:70)
at jd.http.Browser.init(Browser.java:1317)
at jd.update.Main.main(Main.java:119)
Caused by: java.io.FileNotFoundException: /usr/lib/libnss3.so
at sun.security.pkcs11.Secmod.initialize(Secmod.java:186)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:197)
… 18 more
ERROR Could not initialize NSS
Apparently an update broke the configuration of the OpenJDK installation. So to fix it I had to manually edit the file /etc/java-6-openjdk/security/nss.cfg:
name = NSS
#nssLibraryDirectory = /usr/lib
nssLibraryDirectory = /usr/lib/i386-linux-gnu
nssDbMode = noDb
attributes = compatibility
Commenting out the highlighted orange line and adding the highlighted green line. The reason of it is that OpenJDK has split this configuration according to the box architecture (see https://bugs.launchpad.net/ubuntu/+source/nss/+bug/778726). However on my box it failed updating the reference to the new location of the libnss3.so file (I am on Debian Wheezy which is not stable yet so I guess something went wrong).

