Exception in thread "main" java.lang.UnsatisfiedLinkError: /export/opt/jre/1.6.0_20_x64/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Unknown Source)
at java.awt.Toolkit.<clinit>(Unknown Source)
at java.awt.Font.<clinit>(Unknown Source)
at java.awt.font.TextLayout.singleFont(Unknown Source)
at java.awt.font.TextLayout.<init>(Unknown Source)
at org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1701)
at org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1662)
at com.xxx.batch.report.handler.impl.ExcelFileHandler.processFile(ExcelFileHandler.java:115)
at com.xxx.batch.report.base.impl.ReportServiceImpl.processReport(ReportServiceImpl.java:136)
at com.xxx.batch.report.base.impl.ReportServiceImpl.handleReport(ReportServiceImpl.java:48)
at com.xxx.batch.report.main.ReportGenerator.runOneReport(ReportGenerator.java:94)
at com.xxx.batch.report.main.ReportGenerator.runOneGroupReport(ReportGenerator.java:108)
at com.xxx.batch.report.main.ReportGenerator.main(ReportGenerator.java:50)
===============
we have a job xxxAfterEODReportBatch on uat server peculnx1u.nam.nsroot.net, it also was deployed to our production:xxx
when we force start it(sendevent -J xxxAfterEODReportBatch -E FORCE_STARTJOB), it will fail, but when we execute its command manully(/export/opt/xxx/rel_ver/batchReport/scripts/batchReport.sh prod /export/opt/xxx/rel_ver REPORTGROUP AfterEODGrp ), it will succeed.
the error is:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /export/opt/jre/1.6.0_20_x64/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
The job definition is :
insert_job: xxxAfterEODReportBatch job_type: c
command: /export/opt/xxx/rel_ver/batchReport/scripts/batchReport.sh uat /export/opt/xxx/rel_ver REPORTGROUP AfterEODGrp
machine: Vxxx
#owner: xxx@xxx
permission: gx,ge,wx,we,mx,me
date_conditions: 1
days_of_week: mo,tu,we,th,fr
start_times: "23:52"
condition: s(xxxEOD_Calculations)
description: "Produce xxx Daily Reports After EOD Calculation Job Finished"
std_out_file: /export/opt/xxx/rel_ver/log/autosyslog/xxxAfterEODRpt.out.`date +%Y%m%d`
std_err_file: /export/opt/xxx/rel_ver/log/autosyslog/xxxAfterEODRpt.err.`date +%Y%m%d`
alarm_if_fail: 1
it’s very strange that When I update this job by add“profile”, it can be force started successfully.
insert_job: xxxAfterEODReportBatch job_type: c
command: /export/opt/xxx/rel_ver/batchReport/scripts/batchReport.sh uat /export/opt/xxx/rel_ver REPORTGROUP AfterEODGrp
machine: Vxxx
#owner: xxx@xxx
permission: gx,ge,wx,we,mx,me
date_conditions: 1
days_of_week: mo,tu,we,th,fr
start_times: "23:52"
condition: s(xxx_EOD_Calculations)
description: "Produce xxx Daily Reports After EOD Calculation Job Finished"
std_out_file: /export/opt/xxx/rel_ver/log/autosyslog/xxxAfterEODRpt.out.`date +%Y%m%d`
std_err_file: /export/opt/xxx/rel_ver/log/autosyslog/xxxAfterEODRpt.err.`date +%Y%m%d`
alarm_if_fail: 1
profile: /export/opt/xxx/rel_ver/scripts/envForAutosys.sh
===========envForAutosys.sh
#!/bin/sh
#ident "%W%"
#
INSDIR=/export/opt/xxx/rel_ver
FEEDDIR=/export/opt/xxxftp
=================
The key reason is the environment variable“DISPLAY” .
If we add “profile” in autosy job definition, this variable won’t be set, then the autosys job will be executed successfully,
but if we don’t add“profile”, autosys will set DISPLAY=:0.0 default, then the autosys job won’t be executed successfully.
Because we only made some enhancement for Portfolio Net Collateral Report by generating excel report instead of CSV, so we guess that“DISPLAY” variable has something to do with Excel report generation, but we still don’t know the root cause, we will investigate more.
When we call shell scripts directly, it works well, and variable “DISPLAY” is not set in the environment;
But when we call this shell script by autosys job, autosys job will invoke “/etc/auto.profile” automatically, and in this auto.profile,
it set variable “DISPLAY=:0.0”, then it will cause the issue.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /export/opt/jre/1.6.0_20_x64/lib/amd64/xawt/libmawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
If we add command “unset DISPLAY” in our scripts, the job is good, even it still call “/etc/auto.profile”;
We print all environment variables for both success job and failed job, and compare them by cmd "set"