在jenkins shell 排查一個錯誤時,花了很久。
表象是因為 執(zhí)行shell 腳本 中的 java -jar xxx.jar 沒有成功啟動jar 程序。
因為使用了 nohup & 來后臺啟動jar 包,所以jenkins 沒有打印出錯誤 日志。
在去除 nohup & 之后,發(fā)現(xiàn)是報了error unable to access jarfile 錯誤導致的。
解決方案:發(fā)現(xiàn)是 調(diào)用shell腳本 時訪問不到該jar,通過修改jar 絕對路徑解決了文章來源:http://www.zghlxwxcb.cn/news/detail-597287.html
/home/user01/tool/traffic_broker_monitor文章來源地址http://www.zghlxwxcb.cn/news/detail-597287.html
echo "launch monitor tool"
echo "bash /home/user01/tool/test_monitor.sh $monitor_connectors $project $region"
sshpass -p ${PWD} ssh ${USERNAME}@${IP} "bash /home/ser01/tool/test_monitor.sh $monitor_connectors $project $region"
java -jar broker_monitor.jar
--num=$1
--target_server=k8s.mypna.com
--data_source=HERE-HERE-SEA --receiver=\{\"redis_cluster_address\":\"mypna.com\",\"redis_port\":6379\}
到了這里,關于error unable to access jarfile 解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!