2

I'm receiving the error "Could not initialize NSS" in my java application when sending an HTTPS Request. Unfortunally I do not have the complete stack trace of the exception in my log, but from what I have already googled, it is most probably caused by the missing shared object "libnss3.so".

Does anyone know which package I need to install on open suse to get the shared object in the right place ?

markus
  • 6,258
  • 13
  • 41
  • 68

1 Answers1

3

This can help to solve the problem.

Could not initialize NSS

Srikanth Venkatesh
  • 2,812
  • 1
  • 20
  • 13
  • yes, I saw that page, but what package do I need on opens suse? – markus Aug 31 '11 at 13:16
  • http://pkgs.org/download/libnss3.so check for the appropriate package given in that link – Srikanth Venkatesh Aug 31 '11 at 13:20
  • not yet, the library is installed now, but the error is still there. I need to change the application to print the whole stack trace to get further information. – markus Aug 31 '11 at 16:43
  • Now have the Exception:Caused by: java.io.IOException: /usr/lib/libnss3.so: wrong ELF class: ELFCLASS32 at sun.security.pkcs11.Secmod.nssLoadLibrary(Native Method) at sun.security.pkcs11.Secmod.initialize(Secmod.java:203) at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:197) – markus Aug 31 '11 at 20:11
  • I installed accedently the 32 bit library, with the 64 bit library it works now – markus Aug 31 '11 at 20:28
  • 1
    On Ubuntu 11.04 with Zend Studio, the nssLibraryDirectory was set to the libnss3.so file within ZS, instead of a directory. Looking at the result of a find / -name libnss3.so, I saw the system had a version of that file directly below /usr/lib, so I set nssLibraryDirectory = /usr/lib ...and this worked. This might be a more general solution: find the file on disk and replace nssLibraryDirectory with the directory containing it. – FGM Nov 27 '12 at 22:38
  • Thanks a lot @FGM. I had the same problem, and your advise has worked despite I'm using Slackware. – slackmart Dec 14 '14 at 00:36
  • By the way the file is inside the `/etc/java/` directory, and the change was set `nssLibraryDirectory = /usr/lib/` instead of `nssLibraryDirectory = /usr/lib/seamonkey/`. – slackmart Dec 14 '14 at 00:47
  • 1
    The URL can not be opened – Yu Jiaao May 27 '17 at 10:15
  • Archived page is http://web.archive.org/web/20111119055404/http://www.unnaki.com/2011/07/libnss3-so-error-on-debian-wheezy/ – supercalifragilistichespirali Jul 19 '18 at 12:57