sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: Make check for JNDI context a little bit more robust.
Date Fri, 24 Apr 2020 07:49:38 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new beece97  Make check for JNDI context a little bit more robust.
beece97 is described below

commit beece970a43b4824d65f020367efc8de7a06a504
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Apr 24 09:49:02 2020 +0200

    Make check for JNDI context a little bit more robust.
---
 .../main/java/org/apache/sis/internal/metadata/sql/Initializer.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
index 2e50271..0f8069a 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
@@ -32,6 +32,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.naming.NameNotFoundException;
+import javax.naming.NoInitialContextException;
 import javax.naming.spi.NamingManager;
 import javax.naming.event.EventContext;
 import javax.naming.event.NamingEvent;
@@ -294,7 +295,7 @@ public abstract class Initializer {
                      * is cleaned by the listener.
                      */
                 }
-            } catch (NameNotFoundException e) {
+            } catch (NoInitialContextException | NameNotFoundException e) {
                 final LogRecord record = Messages.getResources(null).getLogRecord(
                         Level.CONFIG, Messages.Keys.JNDINotSpecified_1, JNDI);
                 record.setLoggerName(Loggers.SQL);


Mime
View raw message