modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
| 9 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
| 68 ++++++++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanToWorkaroundAS7_5530.java
| 46 ------
3 files changed, 76 insertions(+), 47 deletions(-)
New commits:
commit e20f96e957c17e12ec72dac7a86d158a2915c772
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Sep 21 11:41:21 2012 -0400
work around a deadlock inside AS7 when it tries to deploy our app
diff --git
a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
index 70b6637..946b02c 100644
---
a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
+++
b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
@@ -70,7 +70,14 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet
implements Ins
try {
// If we are already fully installed, we don't have to do anything. Just
return immediately.
- if (getInstallationResults() != null) {
+ String installationResults = getInstallationResults();
+ if (installationResults != null) {
+ if (installationResults.length() == 0) {
+ log("The installer has already been told to perform its work.
The server should be ready soon.");
+ } else {
+ log("The installer has already attempted to install the server
but errors occurred:\n"
+ + installationResults);
+ }
return;
}
} catch (Throwable t) {
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
new file mode 100644
index 0000000..88790d5
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanPreparation.java
@@ -0,0 +1,68 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.server.core;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.Timeout;
+import javax.ejb.TimerConfig;
+import javax.ejb.TimerService;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This startup singleton EJB is here to work around bug AS7-5530 and to
+ * schedule the real StartupBean's work in a delayed fashion (this is to allow
+ * AS7 to complete its deployment work before we do our work).
+ *
+ * See
https://issues.jboss.org/browse/AS7-5530
+ */
+@Singleton
+@Startup
+public class StartupBeanPreparation {
+ private Log log = LogFactory.getLog(this.getClass());
+
+ @EJB
+ private StartupBean startupBean;
+
+ @Resource
+ private TimerService timerService; // needed to schedule our startup bean init call
+
+ @PostConstruct
+ public void initWithTransactionBecauseAS75530() throws RuntimeException {
+ timerService.createSingleActionTimer(10000, new TimerConfig(null, false)); //
call StartupBean in 10s
+ }
+
+ @Timeout
+ public void initializeServer() throws RuntimeException {
+ try {
+ this.startupBean.init();
+ } catch (Throwable t) {
+ // do NOT allow exceptions to bubble out of our method because then
+ // the EJB container would simply re-trigger the timer and call us again
+ // and we don't want to keep failing over and over filling the logs
+ // in an infinite loop.
+ log.fatal("The server failed to start up properly", t);
+ }
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanToWorkaroundAS7_5530.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanToWorkaroundAS7_5530.java
deleted file mode 100644
index f683110..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBeanToWorkaroundAS7_5530.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.core;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.EJB;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-
-/**
- * This startup singleton EJB is here solely to work around bug AS7-5530:
- *
https://issues.jboss.org/browse/AS7-5530
- *
- * When that bug is fixed, delete this class and uncomment the appropriate things in
StartupBean.
- */
-@Singleton
-@Startup
-public class StartupBeanToWorkaroundAS7_5530 {
- @EJB
- private StartupBean startupBean;
-
- @PostConstruct
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- // this @TransactionAttribute annotation is ignored because of bug AS7-5530
- public void initWithTransactionBecauseAS75530() throws RuntimeException {
- this.startupBean.init(); // call init() which is NOT_SUPPORTED so it suspends the
tx bug AS7-5530 gives us erroneously
- }
-}