You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/03/08 11:41:20 UTC

svn commit: r1734050 - in /qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb: StandardEnvironmentFacade.java replication/ReplicatedEnvironmentFacade.java

Author: rgodfrey
Date: Tue Mar  8 10:41:20 2016
New Revision: 1734050

URL: http://svn.apache.org/viewvc?rev=1734050&view=rev
Log:
QPID-7129 : BDB should not attempt to load config from properties files

Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java?rev=1734050&r1=1734049&r2=1734050&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java Tue Mar  8 10:41:20 2016
@@ -38,6 +38,7 @@ import com.sleepycat.je.Database;
 import com.sleepycat.je.DatabaseConfig;
 import com.sleepycat.je.DatabaseEntry;
 import com.sleepycat.je.DatabaseException;
+import com.sleepycat.je.DbInternal;
 import com.sleepycat.je.Environment;
 import com.sleepycat.je.EnvironmentConfig;
 import com.sleepycat.je.EnvironmentMutableConfig;
@@ -96,6 +97,12 @@ public class StandardEnvironmentFacade i
                                                    + "Ensure the path is correct and that the permissions are correct.");
             }
         }
+        else if(_environmentPath.isFile())
+        {
+            throw new IllegalArgumentException("Environment path " + _environmentPath + " exists as a file - not a directory. "
+                                               + "Ensure the path is correct.");
+
+        }
 
         String name = configuration.getName();
         EnvironmentConfig envConfig = new EnvironmentConfig();
@@ -124,6 +131,14 @@ public class StandardEnvironmentFacade i
 
         envConfig.setExceptionListener(new LoggingAsyncExceptionListener());
 
+        DbInternal.setLoadPropertyFile(envConfig, false);
+
+        File propsFile = new File(_environmentPath, "je.properties");
+        if(propsFile.exists())
+        {
+            LOGGER.warn("The BDB configuration file at '" + _environmentPath + File.separator +  "je.properties' will NOT be loaded.  Configure BDB using Qpid context variables instead.");
+        }
+
         EnvHomeRegistry.getInstance().registerHome(_environmentPath);
 
         boolean success = false;

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java?rev=1734050&r1=1734049&r2=1734050&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java Tue Mar  8 10:41:20 2016
@@ -240,6 +240,12 @@ public class ReplicatedEnvironmentFacade
                                                    + "Ensure the path is correct and that the permissions are correct.");
             }
         }
+        else if(_environmentDirectory.isFile())
+        {
+            throw new IllegalArgumentException("Environment path " + _environmentDirectory + " exists as a file - not a directory. "
+                                               + "Ensure the path is correct.");
+
+        }
         else
         {
             LOGGER.debug("Environment at path " + _environmentDirectory + " already exists.");
@@ -1573,6 +1579,15 @@ public class ReplicatedEnvironmentFacade
             envConfig.setConfigParam(configItem.getKey(), configItem.getValue());
         }
 
+        DbInternal.setLoadPropertyFile(envConfig, false);
+
+        File propsFile = new File(_environmentDirectory, "je.properties");
+        if(propsFile.exists())
+        {
+            LOGGER.warn("The BDB configuration file at '" + _environmentDirectory + File.separator +  "je.properties' will NOT be loaded.  Configure BDB using Qpid context variables instead.");
+        }
+
+
         if (createEnvironmentInSeparateThread)
         {
             createEnvironmentInSeparateThread(_environmentDirectory, envConfig, replicationConfig, postCreationAction);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org