我有一个生成一些图片的.jar,这些图片嵌入电子邮件中并发送。
如果我通过shell脚本调用jar并通过命令行运行脚本,因为一切正常,但如果我在crontab中安排脚本,则jar无法创建映像。 JAR日志中也没有显示任何类型的异常消息。
所有文件,文件夹,罐子都具有所有访问权限。
如果需要更多详细信息,请发表评论。
从日志文件中,我收到以下异常消息:
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
at java.awt.Window.<init>(Window.java:547)
at java.awt.Frame.<init>(Frame.java:419)
at javax.swing.JFrame.<init>(JFrame.java:218)
at org.jfree.ui.ApplicationFrame.<init>(ApplicationFrame.java:65)
at com.kpit.cba.wsr.report.deliverymanagerpnp.DeliveryManagerPnPCharts.<init>(DeliveryManagerPnPCharts.java:49)
at com.kpit.cba.wsr.report.deliverymanagerpnp.DeliveryManagerPnPTrends.calculateSBUGraphTrens(DeliveryManagerPnPTrends.java:68)
at com.kpit.cba.wsr.dao.WSRTrendDAO.getWeekWiseSBUTrends(WSRTrendDAO.java:256)
at com.kpit.cba.wsr.dao.WSRTrendDAO.getAllPnPDetails(WSRTrendDAO.java:152)
at com.kpit.cba.wsr.dao.WSRTrendDAO.getOrCodeDetails(WSRTrendDAO.java:65)
at com.kpit.cba.wsr.report.deliverymanagerpes.DeliveryManagerPESBody.setRedFlagsTable(DeliveryManagerPESBody.java:109)
at com.kpit.cba.wsr.report.deliverymanagerpes.DeliveryManagerPESBody.generateBody(DeliveryManagerPESBody.java:64)
at com.kpit.cba.wsr.report.DeliveryManagerPESWSR.generateEmailBody(DeliveryManagerPESWSR.java:129)
at com.kpit.cba.wsr.report.DeliveryManagerPESWSR.sendWSR(DeliveryManagerPESWSR.java:65)
at com.kpit.cba.wsr.report.DeliveryManagerPESWSR.sendReport(DeliveryManagerPESWSR.java:30)
at com.kpit.cba.wsr.main.WSRmain.sendReport(WSRmain.java:96)
at com.kpit.cba.wsr.main.WSRmain.main(WSRmain.java:42)
at com.kpit.cba.wsr.Launcher.main(Launcher.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)