aldivi / caland

ca carbon accounting model
Other
7 stars 7 forks source link

EmptyFileException (Java) error when running CALAND() #81

Closed msimmond closed 4 years ago

msimmond commented 4 years ago

I ran the following using terminal and R version 3.6.3:

CALAND(scen_file_arg="NWL_Alt_A_v6_WLIC_50Private__RCP85.xls", indir = "WLIC", outdir = "WLIC", start_year = 2010, end_year = 2101, value_col_dens = 7, ADD_dens = TRUE, value_col_accum = 7, ADD_accum = TRUE, value_col_soilcon=8, ADD_soilcon = TRUE, NR_Dist = -1, WRITE_OUT_FILE = TRUE, blackC = FALSE)

I've run several other input files is this particular batch of runs without an issue. With this particular run I get the following error once all the simulation years are processed (i.e., after "Starting writing output at Tue Jun 23 14:21:44 2020"):

Error: EmptyFileException (Java): The supplied file was empty (zero bytes long)

The output file is created but it's corrupted.

msimmond commented 4 years ago

After rerunning CALAND() line by line, I confirmed that the error occurs on line 6119:

out_wrkbk =  loadWorkbook(out_file, create = TRUE)

Error: EmptyFileException (Java): The supplied file was empty (zero bytes long)

I tried increasing the memory to 8GB with: options(java.parameters = "-Xmx8g" )

But I get the same error.

This is the java version I have installed: java -version java version "11.0.7" 2020-04-14 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

msimmond commented 4 years ago

I figured out that the issue was because the output file already existed and was corrupted. After deleting it, I could run CALAND() through to completion without an error. I’m not sure why it was created originally but since the problem is resolved, I’m closing the issue.