You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2017/11/09 17:54:39 UTC

[isis] 06/09: ISIS-1756 prevent SQLException on schema creation if config is missing

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 09fdcc01e965e2d2960106e1b70a8ffb98a8d83b
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Oct 30 15:14:16 2017 +0100

    ISIS-1756 prevent SQLException on schema creation if config is missing
---
 .../jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
index d2ee742..6ee60d1 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
@@ -25,8 +25,6 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Map;
 
-import com.google.common.base.Strings;
-
 import org.datanucleus.ClassLoaderResolver;
 import org.datanucleus.enhancer.EnhancementNucleusContextImpl;
 import org.datanucleus.metadata.AbstractClassMetaData;
@@ -35,6 +33,8 @@ import org.datanucleus.store.ConnectionEncryptionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Strings;
+
 
 /**
  * Implementation note: the methods in this class are <tt>protected</tt> to allow for easy subclassing.
@@ -68,6 +68,11 @@ public class CreateSchemaObjectFromClassMetadata implements MetaDataListener, Da
         final String url = properties.get("javax.jdo.option.ConnectionURL");
         final String userName = properties.get("javax.jdo.option.ConnectionUserName");
         final String password = getConnectionPassword();
+        
+        if(Strings.isNullOrEmpty(driverName) || Strings.isNullOrEmpty(url)) {
+        	LOG.warn("Unable to create schema due to missing configuration javax.jdo.option.Connection*");
+        	return;
+        }
 
         try {
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.