[kune-commits] r1731 - trunk/src/main/java/cc/kune/core/server/init

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun Mar 4 20:03:37 CET 2012


Author: vjrj_
Date: 2012-03-04 20:03:36 +0100 (Sun, 04 Mar 2012)
New Revision: 1731

Modified:
   trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
Log:
W$ fix

Modified: trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java	2012-02-29 19:28:31 UTC (rev 1730)
+++ trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java	2012-03-04 19:03:36 UTC (rev 1731)
@@ -25,6 +25,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hibernate.exception.SQLGrammarException;
 import org.waveprotocol.box.server.authentication.PasswordDigest;
 
 import cc.kune.core.client.errors.UserMustBeLoggedException;
@@ -211,10 +212,11 @@
     try {
       groupManager.getSiteDefaultGroup();
     } catch (final NoResultException e) {
-      LOG.warn("The default group '" + properties.getDefaultSiteName()
-          + "' does not exist in Database, "
-          + "creating it (see kune.default.site.shortName in kune.properties for more details)");
-      initDatabase();
+      initialize();
+      // } catch (final MySQLSyntaxErrorException e2) {
+    } catch (final SQLGrammarException e3) {
+      // Seems like in Windows we get this Exception instead
+      initialize();
     }
     translationService.init();
   }
@@ -226,4 +228,10 @@
     createProperties();
     createDefUsersGroup();
   }
+
+  private void initialize() throws Exception {
+    LOG.warn("The default group '" + properties.getDefaultSiteName() + "' does not exist in Database, "
+        + "creating it (see kune.default.site.shortName in kune.properties for more details)");
+    initDatabase();
+  }
 }




More information about the kune-commits mailing list