zowe / sample-spring-boot-api-service

Zowe REST API service SDK and sample API service that integrates with Zowe API Mediation Layer
Other
26 stars 18 forks source link

java.lang.UnsatisfiedLinkError for JNI Code with "zos" profile #14

Closed dkelosky closed 5 years ago

dkelosky commented 5 years ago

When adding the zos profile to configuration and calling native code through JNI, you get UnsatisfiedLinkError during invocation. When starting through JCL, messages like this appear in the job log:

08.14.25 JOB51197  TSS7003W Password Will Expire on 07/01/19                                
08.14.25 JOB51197  TSS7000I xxxxxxx Last-Used 26 Jun 19 06:23 System=xxxx Facility=ZOSMF    
08.14.25 JOB51197  TSS7001I Count=00423 Mode=Fail Locktime=None Name=KELOSKY, DANIEL L      
08.14.25 JOB51197  BPXP015I HFS PROGRAM ./libwtojni.so IS NOT MARKED PROGRAM CONTROLLED.    
08.14.25 JOB51197  TSS7236E ENVIRONMENT IS CONTROLLED - UNIX MARK UNCONTROLLED REQUEST RE   
08.14.25 JOB51197  JECTED                                                                   
08.14.25 JOB51197  BPXP014I ENVIRONMENT MUST REMAIN CONTROLLED FOR DAEMON (BPX.DAEMON) PR   
08.14.25 JOB51197  OCESSING.                                                                

Removing the zos from the profile "resolves" the UnsatisfiedLinkError.

vvvlc commented 5 years ago

does ./libwtojni.so have +p program control attribute? if not use extattr +p libwtojni.so This should help

dkelosky commented 5 years ago

That's it! Is there some good documentation on this? I haven't come across this before.

Thanks!

dkelosky commented 5 years ago

Also, do you know why this is needed with the zos profile?

vvvlc commented 5 years ago

I found this https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb200/dirtyadd.htm

dkelosky commented 5 years ago

Great resource - thanks again!

vvvlc commented 5 years ago

I found this regarding zos profile:

jzos provides PlatformAccessControl, this function calls __check_resource_auth_np, but I don't see requirement of program controlled for __check_resource_auth_np.