Hi Team,
I got a java heap memory error when executing the Cron service. When I restarted STAF the cron.ser and cron_backup.ser files were deleted. I got the files from system administrator and placed the cron.ser file at C:\STAF\data\service\Cron directory and tried to launch STAF but I am getting an error message shown below:
**Error initializing service, CRON, RC: 27, Result: Error initializing service, JS
TAF, Result: ERROR: Cannot load registration data from file C:\STAF\data\STAF\se
rvice\cron\cron.ser.
java.io.EOFException
**
When I open Cron UI using the command: Java -jar C:\STAF\services\cron\STAFCron.jar I am getting the error message shown in screenshot(CRON_UI_Error.png):
Not sure if the cron.ser file is incorrect or am I missing something. I have attached the cron.ser file for your reference.
Here are the additional details:
version=3.4.6
platform=win32
architecture=32-bit
installer=IA
file=STAF346-setup-win32.exe
osname=Windows
osversion=*
osarch=x86
Can someone take a look at this asap as this is affecting our automation jobs.
Sorry forgot to add the attachment for cron.ser. Adding it now.
What version of the Cron service are you using?
STAF local CRON VERSION
I copied the same file on my laptop installed with STAF and Cron services. Getting the same error on my laptop as well. Tried copying cron.ser file from another server to my laptop and launched STAF successfully with Cron data loaded in the Cron UI and no error message displayed in STAFProc window. The problem is with the cron.ser file that I used on the server on which the error message is seen.
Cron.ser file got deleted due to heap memory issue when I restarted STAF on my server machine. Is there any way to restore that file so that I can get the Cron registration data.
Hi Sharon,
Thanks for your reply. I am using Cron version: 3.4.0
I am getting the below error message when I run the command: staf local cron version
C:\Users\vnakka>staf local cron version
Error submitting request, RC: 2
Additional info
cron
I also tried to get the list of services using the command: staf local service list but it didn't ahve any entry related to Cron service. See
C:\Users\vnakka>staf local service list
Response
Name Library Executable
DELAY <internal> <none>
DIAG <internal> <none>
ECHO <internal> <none>
EMAIL JSTAF C:\STAF/services/email/STAFEmail.jar
EVENT JSTAF C:\STAF/services/stax/STAFEvent.jar
EVENTMANAGER JSTAF C:\STAF/services/stax/eventmanager/STAFEventManager.jar
FS <internal> <none>
FTP JSTAF C:\STAF/services/ftp/STAFFTP.jar
HANDLE <internal> <none>
HELP <internal> <none>
LIFECYCLE <internal> <none>
LOG STAFLog <none>
MISC <internal> <none>
PING <internal> <none>
PROCESS <internal> <none>
QUEUE <internal> <none>
RESPOOL STAFPool <none>
SEM <internal> <none>
SERVICE <internal> <none>
SHUTDOWN <internal> <none>
STAX JSTAF C:\STAF/services/stax/STAX.jar
TRACE <internal> <none>
TRUST <internal> <none>
VAR <internal> <none>
ZIP STAFZip <none></none></none></internal></none></internal></none></internal></none></internal></none></internal></none></internal></none></none></internal></none></internal></none></internal></none></internal></none></none></internal></none></internal></none></internal></none></internal></none></internal></none></internal></none></internal>
It appears the cron.ser file you attached is corrupted. I get the same EOFException when I try to register the Cron service using this cron.ser file. Do you have the cron_backup.ser file from your system administrator? Perhaps it is not corrupted. You could try copying it to your data location as cron.ser and then see you can register the Cron service when using it.
Unfortunately we don't have the cron_backup.ser file to restore. I got the cron.ser and cron_back.ser files restored on 2/3 and copying them worked fine. I am able to load all Cron data till 2/3(as the back up of these files were taken on that day via. the second restore point). The only thing that is missing is the data from 2/3 to till date.
Unfortunately, I don't know of a way to restore a corrupted serialized file. You can type/edit the cron.ser file and see the text fields (e.g. like the service requests, e.g. "STAX EXECUTE ..."). But the numeric fields are not viewable.
I got the list of Cron registrations between 2/3 and till date from our DB and developed a script that would create the registraion requests and executed it. There were approximately 400 plus registration requests.
The Cron data was deleted because Java ran out of heap memory and this is seen only for the Cron service. This is the first time I have seen this error. Do I need to increase the heap size so that I won't face this issue again in future?
Last edit: vasu4849 2016-02-11
Yes, you may want to increase the heap size of the JVM that the Cron service is running in. And/or run the Cron service in its own JVM (it you aren't already doing this). When registering the Cron service, you can use OPTION J2=-Xmx512m to set the maximum heap size to 512m for example.
Note: I don't know if 512m is the right maximum heap size for you -- it depends on how you are using the Cron service and how much physical memory your system has).
You can use OPTION JVMName=Cron to set the Cron service to run in its own JVM (assuming no other STAF Java services reistered use JVMName=Cron). For example:
See section "4.4.2 JSTAF service proxy library" in the STAF User's Guide at http://staf.sourceforge.net/current/STAFUG.htm#HDRSERVICEREGCFG for more information on the JSTAF options.
And I need to look at adding better error handling in the Cron service for Java OutOfMemory errors, etc to prevent this from happening again. But, until a fix for this in a new version of the Cron service is available, you probably will want to make backups of the cron.ser file on a regular basis (if you are frequently making so many updates to it) in addition to increasing the maximum heap size of the Cron service's JVM.
Thanks Sharon for adding the details. We have more than 1 versions of JVM installed(Oracle, IBM JVM inbuilt with STAF). We want to move to Orcale's JVM and I increased the heap memory for the Oracle's JVM recently to 4 GB and made STAF point to the Oracle's JVM.
STAF launched fine after making this change and the external services are also loaded. Not sure what went wrong Cron service crashed all of a sudden today because of Out of Memory issue. I checked Physical memory and it looks normal. Not sure why the heap memory issue is seen. Would there be a compatiblity issue between IBM's JVM and Oracle's JVM.
Oracle JVM version used: 1.8.0_111 32 bit
IBM JVM used: 1.6.0 32 bit
Note: The physical memory is good on the machine where I increased the heap memory to 4 GB.
Please let me know if you need any information from me.
I don't think there is a compatibility issue between IBM's JVM and Oracle's JVM.
How much physical memory does this Windows 32-bit system have?
Setting the Maximum Heap Size for the JVM to 4GB may be too large for your systems. See posts such as the following: