diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 43c33dc0868..421777607c0 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -1587,7 +1587,7 @@ dataverse.rserve.port Port number for Rserve, used for tasks that require use of R (to ingest RData files and to save tabular data as RData frames). -Defaults to ``6311``. +Defaults to ``6311`` when not configured or no valid integer. Can also be set via *MicroProfile Config API* sources, e.g. the environment variable ``DATAVERSE_RSERVE_PORT``. diff --git a/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/rdata/RDATAFileReader.java b/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/rdata/RDATAFileReader.java index 1ec0c389049..6d17a5bd553 100644 --- a/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/rdata/RDATAFileReader.java +++ b/src/main/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/rdata/RDATAFileReader.java @@ -438,7 +438,14 @@ public RDATAFileReader(TabularDataFileReaderSpi originator) { // ready to be overridden by a sysadmin. Every time a file would be read with this file reader, // a new reader will be created, reading from the cached config source settings with minimal overhead. this.RSERVE_HOST = JvmSettings.RSERVE_HOST.lookup(); - this.RSERVE_PORT = JvmSettings.RSERVE_PORT.lookup(Integer.class); + int port; + try { + port = JvmSettings.RSERVE_PORT.lookup(Integer.class); + } catch (IllegalArgumentException e) { + LOG.log(Level.SEVERE, "Could not parse value for " + JvmSettings.RSERVE_PORT.getScopedKey() + ", defaulting to 6311", e); + port = 6311; + } + this.RSERVE_PORT = port; this.RSERVE_USER = JvmSettings.RSERVE_USER.lookup(); this.RSERVE_PASSWORD = JvmSettings.RSERVE_PASSWORD.lookup();