Open lizadams opened 7 years ago
E-mail from Greg: "No X11 DISPLAY variable was set, but this program performed an operation which requires it." My response: I was using some other commands that were suggested similar to what is used here that may help. I didn't realize they were still being used when I found the java.awt.HeadlessException error.
You will likely need to check to see if the Xvfb is already running and if not, start it. I think if you try to start two of them, then you will get an error.
the following line is an example that would start Xvfb in true colour mode on linux: /usr/X11R6/bin/Xvfb :1 -screen 0 1280x1024x24 -ac -terminate & now set the display to point to this X frame buffer setenv DISPLAY :1.0 #Set X-windows display
Note: I need to look at why the -batch command isn't able to run without the X11 display.
This issue was reported by Greg Quina at the 15th Annual CMAS conference and in a follow-up e-mail to Liz dated Nov. 1, 2016. Error running a batch script from a crontab
[x] need root permission, to add a cron.txt file to / on your machine note, the hour is in military 31 14 is equivalent to running the job every day at 2:31 pm as 2pm = 14 in military time cat cron.txt min hour dom mon dow command 31 14 echo "Nightly Backup Successful: $(date)" >> /tmp/mybackup.log 31 14 * /Users/lizadams/verdi/bugs/cron_Nov.1.2016/verdi_batch_O3_12km_12Z.liz.csh >& /tmp/mybackup.log
[x] execute the cron file using crontab cron.txt
[x] check status of the cron job using crontab -l
[x] check status of the log file to see if the verdi job was run successfully cat /tmp/mybackup.log /Users/lizadams/VERDI_1.6.0_shapefile_mpas/verdi.command -batch /Users/lizadams/verdi/bugs/cron_Nov.1.2016/scripts/verdi_maxO3.in caught an InvocationTargetException in CorePlugin.loadUIPlugin; printing .getCause() java.awt.HeadlessException
[x] did google search and tried a bunch of things, but then found that this option works: http://stackoverflow.com/questions/21343529/all-my-java-applications-now-throw-a-java-awt-headlessexception
[x] Please add the following option: -Djava.awt.headless=false to the JAVAOPTS option in the verdi.sh file. Edit the cron.txt file to update the date and time for retesting and confirm that it solved the problem
I am not sure what would happen if we leave this option in the verdi.command and verdi.sh script - does it stop the gui from working?