0

I'm trying to get some NSS code working and I'm getting this error:

java.lang.UnsatisfiedLinkError: org.mozilla.jss.ssl.SSLSocket.setSSLDefaultOption(II)V
    at org.mozilla.jss.ssl.SSLSocket.setSSLDefaultOption(Native Method)
    at org.mozilla.jss.ssl.SSLSocket.setSSLDefaultOption(SSLSocket.java:950)
    at org.mozilla.jss.ssl.SSLSocket.enableSSL2Default(SSLSocket.java:523)

I looked at the jss4.dll and I see setSSLDefaultOption within it. The code compiles just fine but it throws this error when it runs.

What might cause something like this?

Also, what does the (II)V mean?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Yes this is entirely a runtime issue, so the code will compile just fine. Either the DLL is not on the library path (and thus Java can't find it to load) or the API has changed in the underlying library and your java wrapper class is trying to load a method that isn't defined in the DLL. – BryanD Dec 17 '09 at 17:43

1 Answers1

1

(IIV) means a void method taking two int parameters. V stands for Void. I for int. What goes inside the parenthesis is the type of the parameters. Return type appears before the parenthesis.

[Edit] Full details of this representation of signatures can be found here: http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#14152

Anyway, regarding the link error that you got. It seems you're compiling against one version of the library and running against an older version, in which the setSSLDefaultOption(int,int) method is not defined.

Itay Maman
  • 30,277
  • 10
  • 88
  • 118