EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Java PDFBlackbox/PAdES libsbbjni64 problem

#34022
Posted: 07/15/2015 02:51:13
by Josepe Measa (Basic support level)
Joined: 07/15/2015
Posts: 2

Hi,

After compiling the sample Java PDFBlackbox/PAdES, I allways get (mac and linux test with jdk7):

Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libsbbjni64

I set libraty path env var, also set on cmd:

Code
LIB=/path/to/secbboxjava/Classes/Java/JNI/OSX
java -Djava.library.path="$LIB:." -cp ../../../../Classes/Java/SecureBlackbox.Base.jar:../../../../Classes/Java/SecureBlackbox.PDF.jar:../../../../Classes/Java/SecureBlackbox.PKI.jar:../../../../Classes/Java/SecureBlackbox.PKIPDF.jar:../../../../Classes/Java/SecureBlackbox.HTTPCommon.jar:../../../../Classes/Java/SecureBlackbox.HTTPClient.jar:../../../../Classes/Java/SecureBlackbox.SSLCommon.jar:../../../../Classes/Java/SecureBlackbox.SSLClient.jar:. Main


But allways the same:

Code
Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libsbbjni64
   at java.lang.Runtime.load0(Runtime.java:792)
   at java.lang.System.load(System.java:1062)
   at SecureBlackbox.Base.JNI$1.run(JNI.java:1671)
   at java.security.AccessController.doPrivileged(Native Method)
   at SecureBlackbox.Base.JNI.initialize(JNI.java:1658)
   at Main.init(Main.java:446)
   at Main.<init>(Main.java:166)
   at Main.main(Main.java:55)


How I can execute the sample?

Best Regards,
#34023
Posted: 07/15/2015 03:04:00
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Please try to pass a full path to JNI module to JNI.initialize method. Meanwhile we'll check why it doesn't work in your case.
#34024
Posted: 07/15/2015 03:40:02
by Josepe Measa (Basic support level)
Joined: 07/15/2015
Posts: 2

Thanks,

Added full path to .so in Main.java:

On Mac: JNI.initialize("/path/to/secbboxjava/Classes/Java/JNI/MacOSX/libsbbjni64.so")

Code
Exception in thread "main" java.lang.UnsatisfiedLinkError: SecureBlackbox.Base.JNI.certOpenStore(Ljava/lang/String;IJILSecureBlackbox/Base/JNI$Pointer;)J
   at SecureBlackbox.Base.JNI.certOpenStore(Native Method)
   at SecureBlackbox.Base.SBWinCrypt.certOpenStore(SBWinCrypt.pas:4177)
   at SecureBlackbox.Base.TElWinCertStorage.open(SBWinCertStorage.pas:1564)
   at SecureBlackbox.Base.TElWinCertStorage.handleStoresChange(SBWinCertStorage.pas:631)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.freepascal.rtl.FpcBaseProcVarType.invokeObjectFunc(system.pp)
   at SecureBlackbox.Base.TJNotifyEvent.invoke(SBStringList.pas)
   at SecureBlackbox.Base.TElStringList.triggerChange(SBStringList.pas:1130)
   at SecureBlackbox.Base.TElStringList.endUpdate(SBStringList.pas:1120)
   at SecureBlackbox.Base.TElStringList.addObject(SBStringList.pas:317)
   at SecureBlackbox.Base.TElStringList.add(SBStringList.pas:283)
   at AddSigDialog.init(AddSigDialog.java:211)
   at AddSigDialog.<init>(AddSigDialog.java:185)
   at Main.init(Main.java:453)
   at Main.<init>(Main.java:166)
   at Main.main(Main.java:55)


On Linux: JNI.initialize("/path/to/secbboxjava/Classes/Java/JNI/MacOSX/libsbbjni64.so")

Code
Exception in thread "main" java.lang.UnsatisfiedLinkError: SecureBlackbox.Base.JNI.certOpenStore(Ljava/lang/String;IJILSecureBlackbox/Base/JNI$Pointer;)J
   at SecureBlackbox.Base.JNI.certOpenStore(Native Method)
   at SecureBlackbox.Base.SBWinCrypt.certOpenStore(SBWinCrypt.pas:4177)
   at SecureBlackbox.Base.TElWinCertStorage.open(SBWinCertStorage.pas:1564)
   at SecureBlackbox.Base.TElWinCertStorage.handleStoresChange(SBWinCertStorage.pas:631)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
   at org.freepascal.rtl.FpcBaseProcVarType.invokeObjectFunc(system.pp)
   at SecureBlackbox.Base.TJNotifyEvent.invoke(SBStringList.pas)
   at SecureBlackbox.Base.TElStringList.triggerChange(SBStringList.pas:1130)
   at SecureBlackbox.Base.TElStringList.endUpdate(SBStringList.pas:1120)
   at SecureBlackbox.Base.TElStringList.addObject(SBStringList.pas:317)
   at SecureBlackbox.Base.TElStringList.add(SBStringList.pas:283)
   at AddSigDialog.init(AddSigDialog.java:211)
   at AddSigDialog.<init>(AddSigDialog.java:185)
   at Main.init(Main.java:453)
   at Main.<init>(Main.java:166)
   at Main.main(Main.java:55
#34025
Posted: 07/15/2015 03:43:16
by Vsevolod Ievgiienko (Team)

The sample was developed on Windows and also shows how to work with Windows certificate stores, that doesn't exist on Linux/OSX. Please comment all code that uses TElWinCertStorage class and it will work.
#34026
Posted: 07/15/2015 06:58:23
by Vsevolod Ievgiienko (Team)

I've sent you a small improvement via Helpdesk. It will allow to load JNI module manually as it seems that library path form is system dependent and JNI.initialize doesn't work on some systems correctly.

Reply

Statistics

Topic viewed 1580 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!