[rhq] Branch 'rhq-on-as7' - modules/enterprise

mazz mazz at fedoraproject.org
Thu Aug 16 22:18:47 UTC 2012


 modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java                    |  138 ++++++++
 modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java              |   41 +-
 modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/JBossASClient.java                        |  108 ++++--
 modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java          |   18 -
 modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/Installer.java                             |   65 +++-
 modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/gwt/InstallerGWTService.java               |   15 
 modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java       |  155 ++++++++--
 modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java             |  141 ++++++---
 modules/enterprise/gui/installer/src/main/resources/org/rhq/enterprise/gui/installer/client/Messages.properties                   |    3 
 modules/enterprise/gui/installer/src/test/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClientTest.java          |    6 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml |    5 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml       |   20 -
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html            |   17 -
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf             |   13 
 modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf           |   13 
 15 files changed, 542 insertions(+), 216 deletions(-)

New commits:
commit d9991080dc34f6889e1506dd77111f0c172a638f
Author: John Mazzitelli <mazz at redhat.com>
Date:   Thu Aug 16 18:18:39 2012 -0400

    after the installer finishes, make sure it deploys the ear
    have installer pop up messages if already installed or the install failed

diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
new file mode 100644
index 0000000..1ff29bc
--- /dev/null
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -0,0 +1,138 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 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.common.jbossas.client.controller;
+
+import java.io.File;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * Provides information to some core services.
+ * 
+ * @author John Mazzitelli
+ */
+public class CoreJBossASClient extends JBossASClient {
+
+    public static final String CORE_SERVICE = "core-service";
+    public static final String SERVER_ENVIRONMENT = "server-environment";
+    public static final String PLATFORM_MBEAN = "platform-mbean";
+    public static final String DEPLOYMENT_SCANNER = "deployment-scanner";
+    public static final String SCANNER = "scanner";
+
+    public CoreJBossASClient(ModelControllerClient client) {
+        super(client);
+    }
+
+    public String getOperatingSystem() throws Exception {
+        final String[] address = { CORE_SERVICE, PLATFORM_MBEAN, "type", "operating-system" };
+        final String osName = getStringAttribute("name", Address.root().add(address));
+        return osName;
+    }
+
+    public String getAppServerVersion() throws Exception {
+        final String version = getStringAttribute("release-version", Address.root());
+        return version;
+    }
+
+    public String getAppServerHomeDir() throws Exception {
+        final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+        final String dir = getStringAttribute(true, "home-dir", Address.root().add(address));
+        return dir;
+    }
+
+    public String getAppServerBaseDir() throws Exception {
+        final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+        final String dir = getStringAttribute(true, "base-dir", Address.root().add(address));
+        return dir;
+    }
+
+    public String getAppServerConfigDir() throws Exception {
+        final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+        final String dir = getStringAttribute(true, "config-dir", Address.root().add(address));
+        return dir;
+    }
+
+    public String getAppServerLogDir() throws Exception {
+        final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+        final String dir = getStringAttribute(true, "log-dir", Address.root().add(address));
+        return dir;
+    }
+
+    public String getAppServerTmpDir() throws Exception {
+        final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+        final String dir = getStringAttribute(true, "temp-dir", Address.root().add(address));
+        return dir;
+    }
+
+    /**
+     * Returns the location where the default deployment scanner is pointing to.
+     * This is where EARs, WARs and the like are deployed to.
+     * @return the default deployments directory - null if there is no deployment scanner
+     * @throws Exception
+     */
+    public String getAppServerDefaultDeploymentDir() throws Exception {
+        final String[] addressArr = { SUBSYSTEM, DEPLOYMENT_SCANNER, SCANNER, "default" };
+        final Address address = Address.root().add(addressArr);
+        final ModelNode resourceAttributes = readResource(address);
+
+        if (resourceAttributes == null) {
+            return null; // there is no default scanner
+        }
+
+        final String path = resourceAttributes.get("path").asString();
+        String relativeTo = null;
+        if (resourceAttributes.hasDefined("relative-to")) {
+            relativeTo = resourceAttributes.get("relative-to").asString();
+        }
+
+        // path = the actual filesystem path to be scanned. Treated as an absolute path,
+        //        unless 'relative-to' is specified, in which case value is treated as relative to that path.
+        // relative-to = Reference to a filesystem path defined in the "paths" section of the server
+        //               configuration, or one of the system properties specified on startup.
+        //               NOTE: here we will assume that if specified, it is a system property name.
+
+        if (relativeTo != null) {
+            String syspropValue = System.getProperty(relativeTo);
+            if (syspropValue == null) {
+                throw new IllegalStateException("Cannot support relative-to that isn't a sysprop: " + relativeTo);
+            }
+            relativeTo = syspropValue;
+        }
+
+        File dir = new File(relativeTo, path);
+        return dir.getAbsolutePath();
+    }
+
+    /**
+     * Set a runtime system property in the JVM that is managed by JBossAS.
+     *
+     * @param name
+     * @param value
+     * @throws Exception
+     */
+    public void setSystemProperty(String name, String value) throws Exception {
+        ModelNode request = createRequest(ADD, Address.root().add(SYSTEM_PROPERTY, name));
+        request.get(VALUE).set(value);
+        ModelNode response = execute(request);
+        if (!isSuccess(response)) {
+            throw new FailureException(response, "Failed to set system property [" + name + "]");
+        }
+    }
+}
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
index 5831b38..142661a 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClient.java
@@ -18,7 +18,6 @@
  */
 package org.rhq.common.jbossas.client.controller;
 
-import java.util.List;
 import java.util.Map;
 
 import org.jboss.as.controller.client.ModelControllerClient;
@@ -50,20 +49,32 @@ public class DatasourceJBossASClient extends JBossASClient {
      */
     public boolean isJDBCDriver(String jdbcDriverName) throws Exception {
         Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_DATASOURCES);
-        ModelNode queryNode = createRequest(READ_RESOURCE, addr);
-        ModelNode results = execute(queryNode);
-        if (isSuccess(results)) {
-            ModelNode drivers = getResults(results).get(JDBC_DRIVER);
-            List<ModelNode> list = drivers.asList();
-            for (ModelNode driver : list) {
-                if (driver.has(jdbcDriverName)) {
-                    return true;
-                }
-            }
-            return false;
-        } else {
-            throw new FailureException(results, "Failed to get JDBC drivers");
-        }
+        String haystack = JDBC_DRIVER;
+        return null != findNodeInList(addr, haystack, jdbcDriverName);
+    }
+
+    /**
+     * Checks to see if there is already a datasource with the given name.
+     *
+     * @param datasourceName the name to check
+     * @return true if there is a datasource with the given name already in existence
+     */
+    public boolean isDatasource(String datasourceName) throws Exception {
+        Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_DATASOURCES);
+        String haystack = DATA_SOURCE;
+        return null != findNodeInList(addr, haystack, datasourceName);
+    }
+
+    /**
+     * Checks to see if there is already a XA datasource with the given name.
+     *
+     * @param datasourceName the name to check
+     * @return true if there is a XA datasource with the given name already in existence
+     */
+    public boolean isXADatasource(String datasourceName) throws Exception {
+        Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_DATASOURCES);
+        String haystack = XA_DATA_SOURCE;
+        return null != findNodeInList(addr, haystack, datasourceName);
     }
 
     /**
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/JBossASClient.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/JBossASClient.java
index 576e2d6..ccbcc1d 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/JBossASClient.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/JBossASClient.java
@@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
 import org.jboss.as.controller.client.ModelControllerClient;
 import org.jboss.as.controller.client.OperationMessageHandler;
 import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
 
 /**
  * A client that can be used to talk to a JBossAS server via the DMR/ModelControllerClient API.
@@ -87,7 +88,7 @@ public class JBossASClient {
      * @return the request
      */
     public static ModelNode createReadAttributeRequest(boolean runtime, String attributeName, Address address) {
-        ModelNode op = createRequest(READ_ATTRIBUTE, address);
+        final ModelNode op = createRequest(READ_ATTRIBUTE, address);
         op.get("include-runtime").set(runtime);
         op.get(NAME).set(attributeName);
         return op;
@@ -103,7 +104,7 @@ public class JBossASClient {
      * @return the request
      */
     public static ModelNode createWriteAttributeRequest(String attributeName, String attributeValue, Address address) {
-        ModelNode op = createRequest(WRITE_ATTRIBUTE, address);
+        final ModelNode op = createRequest(WRITE_ATTRIBUTE, address);
         op.get(NAME).set(attributeName);
         op.get(VALUE).set(attributeValue);
         return op;
@@ -136,7 +137,9 @@ public class JBossASClient {
         composite.get(ADDRESS).setEmptyList();
         final ModelNode stepsNode = composite.get(BATCH_STEPS);
         for (ModelNode step : steps) {
-            stepsNode.add(step);
+            if (step != null) {
+                stepsNode.add(step);
+            }
         }
         return composite;
     }
@@ -153,12 +156,12 @@ public class JBossASClient {
             return Collections.emptyList();
         }
 
-        List<ModelNode> nodeList = operationResult.get(RESULT).asList();
+        final List<ModelNode> nodeList = operationResult.get(RESULT).asList();
         if (nodeList.isEmpty()) {
             return Collections.emptyList();
         }
 
-        List<String> list = new ArrayList<String>(nodeList.size());
+        final List<String> list = new ArrayList<String>(nodeList.size());
         for (ModelNode node : nodeList) {
             list.add(node.asString());
         }
@@ -182,32 +185,6 @@ public class JBossASClient {
     }
 
     /**
-     * Examines the given node's result list and if the item is found, returns true.
-     * 
-     * @param operationResult the node to examine
-     * @param item the item to look for in the node's result list
-     * @return true if the node has a result list and it contains the item; false otherwise
-     */
-    public static boolean listContains(ModelNode operationResult, String item) {
-        if (!operationResult.hasDefined(RESULT)) {
-            return false;
-        }
-
-        List<ModelNode> nodeList = operationResult.get(RESULT).asList();
-        if (nodeList.isEmpty()) {
-            return false;
-        }
-
-        for (ModelNode node : nodeList) {
-            if (node.asString().equals(item)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
      * Returns <code>true</code> if the operation was a success; <code>false</code> otherwise.
      * 
      * @param operationResult the operation result to test
@@ -234,7 +211,7 @@ public class JBossASClient {
             return null;
         }
         if (operationResult != null) {
-            ModelNode descr = operationResult.get(FAILURE_DESCRIPTION);
+            final ModelNode descr = operationResult.get(FAILURE_DESCRIPTION);
             if (descr != null) {
                 return descr.asString();
             }
@@ -266,6 +243,26 @@ public class JBossASClient {
     }
 
     /**
+     * This returns information on the resource at the given address.
+     * This will not return an exception if the address points to a non-existent resource, rather,
+     * it will just return null. You can use this as a test for resource existence.
+     *
+     * @param addr
+     * @return the found item or null if not found
+     * @throws Exception if some error prevented the lookup from even happening
+     */
+    public ModelNode readResource(Address addr) throws Exception {
+        final ModelNode request = createRequest(READ_RESOURCE, addr);
+        final ModelNode results = getModelControllerClient().execute(request, OperationMessageHandler.logging);
+        if (isSuccess(results)) {
+            final ModelNode resource = getResults(results);
+            return resource;
+        } else {
+            return null;
+        }
+    }
+
+    /**
      * Convienence method that allows you to obtain a single attribute's string value from
      * a resource.
      * 
@@ -291,11 +288,11 @@ public class JBossASClient {
      * @throws Exception if failed to obtain the attribute value
      */
     public String getStringAttribute(boolean runtime, String attributeName, Address address) throws Exception {
-        ModelNode op = createReadAttributeRequest(runtime, attributeName, address);
-        ModelNode results = execute(op);
+        final ModelNode op = createReadAttributeRequest(runtime, attributeName, address);
+        final ModelNode results = execute(op);
         if (isSuccess(results)) {
-            ModelNode version = getResults(results);
-            String attributeValue = version.asString();
+            final ModelNode version = getResults(results);
+            final String attributeValue = version.asString();
             return attributeValue;
         } else {
             throw new FailureException(results, "Failed to get attribute [" + attributeName + "] from [" + address
@@ -304,18 +301,37 @@ public class JBossASClient {
     }
 
     /**
-     * Can set a runtime system property in the JVM.
+     * This tries to find specific node within a list of nodes. Given an address and a named node
+     * at that address (the "haystack"), it is assumed that haystack is actually a list of other
+     * nodes. This method looks in the haystack and tries to find the named needle. If it finds it,
+     * that list item is returned. If it does not find the needle in the haystack, it returns null.
      *
-     * @param name
-     * @param value
-     * @throws Exception
+     * For example, if you want to find a specific datasource in the list of datasources, you
+     * can pass in the address for the datasource subsystem, and ask to look in the data-source
+     * node list (the haystack) and return the named datasource (the needle).
+     *
+     * @param addr
+     * @param haystack
+     * @param needle
+     * @return the found item or null if not found
+     * @throws Exception if the lookup fails for some reason
      */
-    public void setSystemProperty(String name, String value) throws Exception {
-        ModelNode request = createRequest(ADD, Address.root().add(SYSTEM_PROPERTY, name));
-        request.get(VALUE).set(value);
-        ModelNode response = execute(request);
-        if (!isSuccess(response)) {
-            throw new FailureException(response, "Failed to set system property [" + name + "]");
+    public ModelNode findNodeInList(Address addr, String haystack, String needle) throws Exception {
+        final ModelNode queryNode = createRequest(READ_RESOURCE, addr);
+        final ModelNode results = execute(queryNode);
+        if (isSuccess(results)) {
+            final ModelNode haystackNode = getResults(results).get(haystack);
+            if (haystackNode.getType() != ModelType.UNDEFINED) {
+                final List<ModelNode> haystackList = haystackNode.asList();
+                for (ModelNode needleNode : haystackList) {
+                    if (needleNode.has(needle)) {
+                        return needleNode;
+                    }
+                }
+            }
+            return null;
+        } else {
+            throw new FailureException(results, "Failed to get data for [" + addr + "]");
         }
     }
 }
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
index 6f0589f..b1e8782 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/common/jbossas/client/controller/SecurityDomainJBossASClient.java
@@ -18,8 +18,6 @@
  */
 package org.rhq.common.jbossas.client.controller;
 
-import java.util.List;
-
 import org.jboss.as.controller.client.ModelControllerClient;
 import org.jboss.dmr.ModelNode;
 
@@ -54,20 +52,8 @@ public class SecurityDomainJBossASClient extends JBossASClient {
      */
     public boolean isSecurityDomain(String securityDomainName) throws Exception {
         Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY);
-        ModelNode queryNode = createRequest(READ_RESOURCE, addr);
-        ModelNode results = execute(queryNode);
-        if (isSuccess(results)) {
-            ModelNode domains = getResults(results).get(SECURITY_DOMAIN);
-            List<ModelNode> list = domains.asList();
-            for (ModelNode domain : list) {
-                if (domain.has(securityDomainName)) {
-                    return true;
-                }
-            }
-            return false;
-        } else {
-            throw new FailureException(results, "Failed to get security domains");
-        }
+        String haystack = SECURITY_DOMAIN;
+        return null != findNodeInList(addr, haystack, securityDomainName);
     }
 
     /**
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/Installer.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/Installer.java
index f0921ba..2dd4e4c 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/Installer.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/Installer.java
@@ -27,10 +27,12 @@ import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.smartgwt.client.types.Alignment;
 import com.smartgwt.client.types.Side;
 import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.util.BooleanCallback;
 import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Canvas;
@@ -77,9 +79,10 @@ import org.rhq.enterprise.gui.installer.client.shared.ServerProperties;
 public class Installer implements EntryPoint {
 
     // This must come first to ensure proper I18N class loading for dev mode
-    public static final Messages MSG = GWT.create(Messages.class);
-    public static final ServerPropertiesMessages PROPS_MSG = GWT.create(ServerPropertiesMessages.class);
+    private static final Messages MSG = GWT.create(Messages.class);
+    private static final ServerPropertiesMessages PROPS_MSG = GWT.create(ServerPropertiesMessages.class);
 
+    private static final String INSTALLED_APP_URL = "/"; // if already installed, this is the URL context where it can be accessed
     private static final String NEW_SERVER_TO_REGISTER = "*new*";
 
     private final InstallerGWTServiceAsync installerService = InstallerGWTServiceAsync.Util.getInstance();
@@ -109,28 +112,66 @@ public class Installer implements EntryPoint {
     private TextItem serverSettingEmailFromAddress;
 
     public void onModuleLoad() {
-        Canvas header = createHeader();
-        mainInstallButton = createMainInstallButton();
-        Canvas tabSet = createTabSet();
-
         mainCanvas = new VLayout();
         mainCanvas.setWidth100();
         mainCanvas.setHeight100();
         mainCanvas.setLayoutMargin(10);
         mainCanvas.setMembersMargin(5);
         mainCanvas.setDefaultLayoutAlign(Alignment.CENTER);
-        mainCanvas.addMember(header);
-        mainCanvas.addMember(mainInstallButton);
-        mainCanvas.addMember(tabSet);
         mainCanvas.draw();
 
+        installerService.getInstallationResults(new AsyncCallback<String>() {
+            public void onSuccess(String result) {
+                if (result == null) {
+                    prepareInstallerView(); // we need the user to complete the installation
+                } else if (result.length() == 0) {
+                    showInstalledDialog(); // nothing needs to be done, we are already installed
+                } else {
+                    showInstallationErrorDialog(result);
+                }
+            }
+
+            public void onFailure(Throwable caught) {
+                SC.warn(MSG.message_install_doNotKnowIfInstalled(caught.toString()), new BooleanCallback() {
+                    public void execute(Boolean value) {
+                        prepareInstallerView();
+                    }
+                });
+            }
+        });
+
         // Remove loading image in case we don't completely cover it
         Element loadingPanel = DOM.getElementById("Loading-Panel");
         loadingPanel.removeFromParent();
 
+        return;
+    }
+
+    private void showInstallationErrorDialog(String error) {
+        SC.warn(MSG.message_install_failed() + "<br/>" + error);
+    }
+
+    private void showInstalledDialog() {
+        String loginMsg = MSG.message_install_loginHere(INSTALLED_APP_URL);
+        SC.say(loginMsg, new BooleanCallback() {
+            public void execute(Boolean value) {
+                Window.open(INSTALLED_APP_URL, "_self", null);
+            }
+        });
+    }
+
+    private void prepareInstallerView() {
+        Canvas header = createHeader();
+        mainInstallButton = createMainInstallButton();
+        Canvas tabSet = createTabSet();
+
+        mainCanvas.addMember(header);
+        mainCanvas.addMember(mainInstallButton);
+        mainCanvas.addMember(tabSet);
+        mainCanvas.draw();
+
         // get the server properties from the server
         loadServerProperties();
-
     }
 
     private void updateServerProperty(String name, Object value) {
@@ -229,13 +270,13 @@ public class Installer implements EntryPoint {
                     @Override
                     public void onSuccess(Void result) {
                         mainCanvas.enable();
-                        SC.say(MSG.message_install_done());
+                        showInstalledDialog();
                     }
 
                     @Override
                     public void onFailure(Throwable caught) {
                         mainCanvas.enable();
-                        SC.say(MSG.message_install_failed() + " - " + caught.toString());
+                        showInstallationErrorDialog(caught.toString());
                     }
                 });
             }
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/gwt/InstallerGWTService.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/gwt/InstallerGWTService.java
index 97e776e..5788b22 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/gwt/InstallerGWTService.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/gwt/InstallerGWTService.java
@@ -34,6 +34,21 @@ import org.rhq.enterprise.gui.installer.server.servlet.ServerInstallUtil;
 public interface InstallerGWTService extends RemoteService {
 
     /**
+     * Use this to determine if the server has already been completely installed or not.
+     * This returns a String to indicate the last installation attempt. If this returns null,
+     * then the installer has not done anything yet - you need to complete the installation.
+     * If an empty string is returned, it means the installer ran and it appears the application
+     * has successfully installed. If a non-empty string is returned, it means the installer attempted
+     * to complete the installation, but an error occurred.  When a non-empty string is returned,
+     * it means that an administrator probably has to do some manual intervention because something
+     * went wrong with the application deployment.
+     *
+     * @return indicating of the last installation attempt (see above)
+     * @throws Exception if it cannot be determined if the server has been fully installed.
+     */
+    String getInstallationResults() throws Exception;
+
+    /**
      * Starts the installation process. Once complete, the installer has nothing more it needs to do.
      *
      * @param serverProperties the server's settings to use. These will be persisted to
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 9a1b792..899f423 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
@@ -18,7 +18,11 @@
  */
 package org.rhq.enterprise.gui.installer.server.servlet;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -34,8 +38,7 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 
 import org.jboss.as.controller.client.ModelControllerClient;
 
-import org.rhq.common.jbossas.client.controller.Address;
-import org.rhq.common.jbossas.client.controller.JBossASClient;
+import org.rhq.common.jbossas.client.controller.CoreJBossASClient;
 import org.rhq.core.db.DatabaseTypeFactory;
 import org.rhq.core.util.PropertiesFileUpdate;
 import org.rhq.core.util.exception.ThrowableUtil;
@@ -44,6 +47,7 @@ import org.rhq.enterprise.gui.installer.client.shared.ServerDetails;
 import org.rhq.enterprise.gui.installer.client.shared.ServerProperties;
 import org.rhq.enterprise.gui.installer.server.service.ManagementService;
 import org.rhq.enterprise.gui.installer.server.servlet.ServerInstallUtil.ExistingSchemaOption;
+import org.rhq.enterprise.gui.installer.server.servlet.ServerInstallUtil.Marker;
 import org.rhq.enterprise.gui.installer.server.servlet.ServerInstallUtil.SupportedDatabaseType;
 
 /**
@@ -56,10 +60,24 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
 
     private static final long serialVersionUID = 1L;
 
+    private static final String INSTALLER_NAME = "rhq-installer.war";
+    private static final String EAR_NAME = "rhq.ear";
+
     @Override
     public void init() throws ServletException {
         super.init();
 
+        try {
+            // If we are already fully installed, we don't have to do anything. Just return immediately.
+            if (getInstallationResults() != null) {
+                return;
+            }
+        } catch (Throwable t) {
+            log("Cannot determine if server has already been installed; aborting auto-install if enabled. Installer may not work properly.",
+                t);
+            return;
+        }
+
         // our installer is ready - let's see if we are in auto-install mode - if so, begin the install immediately
         final boolean autoInstallMode;
         final HashMap<String, String> serverProperties;
@@ -91,6 +109,28 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
     }
 
     @Override
+    public String getInstallationResults() throws Exception {
+        // use JBossAS's marker files to determine the status of the application EAR
+        CoreJBossASClient client = new CoreJBossASClient(getClient());
+        String deployDir = client.getAppServerDefaultDeploymentDir();
+        boolean deployedExists = ServerInstallUtil.markerFileExists(deployDir, EAR_NAME, Marker.DEPLOYED);
+        boolean failedExists = ServerInstallUtil.markerFileExists(deployDir, EAR_NAME, Marker.FAILED);
+        if (!failedExists) {
+            if (deployedExists) {
+                return ""; // everything looks OK and the ear has been successfully deployed
+            } else {
+                return null; // installer hasn't done anything yet
+            }
+        } else {
+            String error = slurpFile(ServerInstallUtil.getMarkerFile(deployDir, EAR_NAME, Marker.FAILED));
+            if (error.length() == 0) {
+                error = "Unknown installation error";
+            }
+            return error;
+        }
+    }
+
+    @Override
     public void install(HashMap<String, String> serverProperties, ServerDetails serverDetails,
         String existingSchemaOption) throws Exception {
 
@@ -278,7 +318,9 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
         // now create our deployment services and our main EAR
         deployServices(serverProperties);
 
-        // TODO: deploy the EAR
+        // deploy the EAR and undeploy this installer - this will shut us down within seconds, return fast!
+        deployApp();
+
         return;
     }
 
@@ -389,38 +431,34 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
 
     @Override
     public String getAppServerVersion() throws Exception {
-        final JBossASClient client = new JBossASClient(getClient());
-        final String version = client.getStringAttribute("release-version", Address.root());
+        final CoreJBossASClient client = new CoreJBossASClient(getClient());
+        final String version = client.getAppServerVersion();
         return version;
     }
 
     @Override
     public String getOperatingSystem() throws Exception {
-        final JBossASClient client = new JBossASClient(getClient());
-        final String[] address = { "core-service", "platform-mbean", "type", "operating-system" };
-        final String osName = client.getStringAttribute("name", Address.root().add(address));
+        final CoreJBossASClient client = new CoreJBossASClient(getClient());
+        final String osName = client.getOperatingSystem();
         return osName;
     }
 
     private String getAppServerHomeDir() throws Exception {
-        final JBossASClient client = new JBossASClient(getClient());
-        final String[] address = { "core-service", "server-environment" };
-        final String dir = client.getStringAttribute(true, "home-dir", Address.root().add(address));
+        final CoreJBossASClient client = new CoreJBossASClient(getClient());
+        final String dir = client.getAppServerHomeDir();
         return dir;
     }
 
     private String getAppServerConfigDir() throws Exception {
-        final JBossASClient client = new JBossASClient(getClient());
-        final String[] address = { "core-service", "server-environment" };
-        final String dir = client.getStringAttribute(true, "config-dir", Address.root().add(address));
+        final CoreJBossASClient client = new CoreJBossASClient(getClient());
+        final String dir = client.getAppServerConfigDir();
         return dir;
     }
 
     private String getLogDir() throws Exception {
-        final File asHomeDir = new File(getAppServerHomeDir());
-        final File logDir = new File(asHomeDir, "../logs"); // this is RHQ's log dir, not JBossAS's log dir
-        logDir.mkdirs(); // create it in case it doesn't yet exist
-        return logDir.getAbsolutePath();
+        final CoreJBossASClient client = new CoreJBossASClient(getClient());
+        final String dir = client.getAppServerLogDir();
+        return dir;
     }
 
     private File getServerPropertiesFile() throws Exception {
@@ -540,4 +578,85 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
             throw new Exception("Failed to deploy services: " + ThrowableUtil.getAllMessages(e));
         }
     }
+
+    private void deployApp() throws Exception {
+        try {
+            final CoreJBossASClient client = new CoreJBossASClient(getClient());
+            final String deployDir = client.getAppServerDefaultDeploymentDir();
+            if (deployDir == null) {
+                throw new IllegalStateException("Missing the deployment scanner - cannot finish install");
+            }
+
+            // set up our marker files so the app server deploys the ear
+            ServerInstallUtil.deleteMarkerFile(deployDir, EAR_NAME, Marker.FAILED);
+            ServerInstallUtil.deleteMarkerFile(deployDir, EAR_NAME, Marker.SKIP_DEPLOY);
+            ServerInstallUtil.touchMarkerFile(deployDir, EAR_NAME, Marker.DO_DEPLOY);
+
+            // We can leave the installer always deployed. It won't do anything if main EAR is deployed.
+            // Leaving it deployed will allow the installer URL to be live, so people who mistakenly go
+            // to the installer will be told (by the installer) that things are installed and it will give
+            // the real URL to the user as a help to get them started.
+            // In case we do want to undeploy the installer, I left the code intact here. Just uncomment this line below:
+            // undeployInstaller();
+        } catch (Exception e) {
+            log("deployApp failed", e);
+            throw new Exception("Failed to deploy the app: " + ThrowableUtil.getAllMessages(e));
+        }
+    }
+
+    // left this here in case we want to undeploy the installer in the future; for now, we don't use this
+    private void undeployInstaller() throws Exception {
+        try {
+            final CoreJBossASClient client = new CoreJBossASClient(getClient());
+            final String deployDir = client.getAppServerDefaultDeploymentDir();
+            if (deployDir == null) {
+                throw new IllegalStateException("Missing the deployment scanner - cannot undeploy installer");
+            }
+
+            ServerInstallUtil.touchMarkerFile(deployDir, INSTALLER_NAME, Marker.SKIP_DEPLOY);
+
+            // This will shut the installer down and undeploy it.
+            // We do it in a separate thread to let this current request thread be able to return and finish.
+            new Thread(new Runnable() {
+                public void run() {
+                    try {
+                        Thread.sleep(3000L); // gives the calling thread time to finish
+                    } catch (InterruptedException e) {
+                    }
+                    try {
+                        log("Installer has completed its work and is no longer needed. It is being undeployed...");
+                        ServerInstallUtil.deleteMarkerFile(deployDir, INSTALLER_NAME, Marker.DEPLOYED);
+                        log("Installer has been undeployed");
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }, "RHQ Installer Undeploy Thread").start();
+        } catch (Exception e) {
+            log("undeployInstaller failed", e);
+            throw new Exception("Failed to undeploy the installer: " + ThrowableUtil.getAllMessages(e));
+        }
+    }
+
+    private String slurpFile(File theFile) {
+        FileInputStream fis = null;
+        try {
+            byte[] buffer = new byte[32768];
+            fis = new FileInputStream(theFile);
+            BufferedInputStream input = new BufferedInputStream(fis, buffer.length);
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+            for (int bytesRead = input.read(buffer); bytesRead != -1; bytesRead = input.read(buffer)) {
+                out.write(buffer, 0, bytesRead);
+            }
+            return out.toString();
+        } catch (Exception ioe) {
+            throw new RuntimeException("Cannot slurp file: " + theFile, ioe);
+        } finally {
+            try {
+                fis.close();
+            } catch (IOException e) {
+            }
+        }
+    }
 }
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
index 04789a0..32af0f4 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
@@ -78,6 +78,20 @@ public class ServerInstallUtil {
         POSTGRES, ORACLE
     };
 
+    public enum Marker {
+        DO_DEPLOY(".dodeploy"), SKIP_DEPLOY(".skipdeploy"), DEPLOYED(".deployed"), FAILED(".failed");
+
+        private String extension;
+
+        private Marker(String ext) {
+            extension = ext;
+        }
+
+        public String getExtenstion() {
+            return extension;
+        }
+    }
+
     private static final String RHQ_DATASOURCE_NAME_NOTX = "NoTxRHQDS";
     private static final String RHQ_DATASOURCE_NAME_XA = "RHQDS";
     private static final String RHQ_SECURITY_DOMAIN = "RHQDSSecurityDomain";
@@ -294,30 +308,43 @@ public class ServerInstallUtil {
         final HashMap<String, String> props = new HashMap<String, String>(4);
         final DatasourceJBossASClient client = new DatasourceJBossASClient(mcc);
 
-        props.put("char.encoding", "UTF-8");
+        ModelNode noTxDsRequest = null;
+        ModelNode xaDsRequest = null;
 
-        ModelNode noTxDsRequest = client.createNewDatasourceRequest(RHQ_DATASOURCE_NAME_NOTX, 30000,
-            "${rhq.server.database.connection-url:jdbc:postgres://127.0.0.1:5432/rhq}", JDBC_DRIVER_POSTGRES,
-            "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter", 15, false, 2, 5, 75,
-            RHQ_SECURITY_DOMAIN, "-unused-stale-conn-checker-", "TRANSACTION_READ_COMMITTED",
-            "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker", props);
-        noTxDsRequest.get("steps").get(0).remove("stale-connection-checker-class-name"); // we don't have one of these for postgres
+        if (!client.isDatasource(RHQ_DATASOURCE_NAME_NOTX)) {
+            props.put("char.encoding", "UTF-8");
 
-        props.clear();
-        props.put("ServerName", "${rhq.server.database.server-name:127.0.0.1}");
-        props.put("PortNumber", "${rhq.server.database.port:5432}");
-        props.put("DatabaseName", "${rhq.server.database.db-name:rhq}");
+            noTxDsRequest = client.createNewDatasourceRequest(RHQ_DATASOURCE_NAME_NOTX, 30000,
+                "${rhq.server.database.connection-url:jdbc:postgres://127.0.0.1:5432/rhq}", JDBC_DRIVER_POSTGRES,
+                "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter", 15, false, 2, 5, 75,
+                RHQ_SECURITY_DOMAIN, "-unused-stale-conn-checker-", "TRANSACTION_READ_COMMITTED",
+                "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker", props);
+            noTxDsRequest.get("steps").get(0).remove("stale-connection-checker-class-name"); // we don't have one of these for postgres
+        } else {
+            LOG.info("Postgres datasource [" + RHQ_DATASOURCE_NAME_NOTX + "] already exists");
+        }
 
-        ModelNode xaDsRequest = client.createNewXADatasourceRequest(RHQ_DATASOURCE_NAME_XA, 30000,
-            JDBC_DRIVER_POSTGRES, "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter", 15, 5,
-            50, 75, RHQ_SECURITY_DOMAIN, "-unused-stale-conn-checker-", "TRANSACTION_READ_COMMITTED",
-            "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker", props);
-        xaDsRequest.get("steps").get(0).remove("stale-connection-checker-class-name"); // we don't have one of these for postgres
+        if (!client.isXADatasource(RHQ_DATASOURCE_NAME_XA)) {
+            props.clear();
+            props.put("ServerName", "${rhq.server.database.server-name:127.0.0.1}");
+            props.put("PortNumber", "${rhq.server.database.port:5432}");
+            props.put("DatabaseName", "${rhq.server.database.db-name:rhq}");
+
+            xaDsRequest = client.createNewXADatasourceRequest(RHQ_DATASOURCE_NAME_XA, 30000, JDBC_DRIVER_POSTGRES,
+                "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter", 15, 5, 50, 75,
+                RHQ_SECURITY_DOMAIN, "-unused-stale-conn-checker-", "TRANSACTION_READ_COMMITTED",
+                "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker", props);
+            xaDsRequest.get("steps").get(0).remove("stale-connection-checker-class-name"); // we don't have one of these for postgres
+        } else {
+            LOG.info("Postgres XA datasource [" + RHQ_DATASOURCE_NAME_XA + "] already exists");
+        }
 
-        ModelNode batch = DatasourceJBossASClient.createBatchRequest(noTxDsRequest, xaDsRequest);
-        ModelNode results = client.execute(batch);
-        if (!DatasourceJBossASClient.isSuccess(results)) {
-            throw new FailureException(results, "Failed to create Postgres datasources");
+        if (noTxDsRequest != null || xaDsRequest != null) {
+            ModelNode batch = DatasourceJBossASClient.createBatchRequest(noTxDsRequest, xaDsRequest);
+            ModelNode results = client.execute(batch);
+            if (!DatasourceJBossASClient.isSuccess(results)) {
+                throw new FailureException(results, "Failed to create Postgres datasources");
+            }
         }
     }
 
@@ -325,29 +352,43 @@ public class ServerInstallUtil {
         final HashMap<String, String> props = new HashMap<String, String>(2);
         final DatasourceJBossASClient client = new DatasourceJBossASClient(mcc);
 
-        props.put("char.encoding", "UTF-8");
-        props.put("SetBigStringTryClob", "true");
+        ModelNode noTxDsRequest = null;
+        ModelNode xaDsRequest = null;
 
-        ModelNode noTxDsRequest = client.createNewDatasourceRequest(RHQ_DATASOURCE_NAME_NOTX, 30000,
-            "${rhq.server.database.connection-url:jdbc:oracle:thin:@127.0.0.1:1521:rhq}", JDBC_DRIVER_ORACLE,
-            "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter", 15, false, 2, 5, 75,
-            RHQ_SECURITY_DOMAIN, "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker",
-            "TRANSACTION_READ_COMMITTED", "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker",
-            props);
+        if (!client.isDatasource(RHQ_DATASOURCE_NAME_NOTX)) {
+            props.put("char.encoding", "UTF-8");
+            props.put("SetBigStringTryClob", "true");
 
-        props.clear();
-        props.put("URL", "${rhq.server.database.connection-url:jdbc:oracle:thin:@127.0.0.1:1521:rhq}");
-        props.put("ConnectionProperties", "SetBigStringTryClob=true");
+            noTxDsRequest = client.createNewDatasourceRequest(RHQ_DATASOURCE_NAME_NOTX, 30000,
+                "${rhq.server.database.connection-url:jdbc:oracle:thin:@127.0.0.1:1521:rhq}", JDBC_DRIVER_ORACLE,
+                "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter", 15, false, 2, 5, 75,
+                RHQ_SECURITY_DOMAIN, "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker",
+                "TRANSACTION_READ_COMMITTED",
+                "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker", props);
+        } else {
+            LOG.info("Oracle datasource [" + RHQ_DATASOURCE_NAME_NOTX + "] already exists");
+        }
 
-        ModelNode xaDsRequest = client.createNewXADatasourceRequest(RHQ_DATASOURCE_NAME_XA, 30000, JDBC_DRIVER_ORACLE,
-            "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter", 15, 5, 50, 75, RHQ_SECURITY_DOMAIN,
-            "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker", "TRANSACTION_READ_COMMITTED",
-            "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker", props);
+        if (!client.isDatasource(RHQ_DATASOURCE_NAME_XA)) {
+            props.clear();
+            props.put("URL", "${rhq.server.database.connection-url:jdbc:oracle:thin:@127.0.0.1:1521:rhq}");
+            props.put("ConnectionProperties", "SetBigStringTryClob=true");
 
-        ModelNode batch = DatasourceJBossASClient.createBatchRequest(noTxDsRequest, xaDsRequest);
-        ModelNode results = client.execute(batch);
-        if (!DatasourceJBossASClient.isSuccess(results)) {
-            throw new FailureException(results, "Failed to create Oracle datasources");
+            xaDsRequest = client.createNewXADatasourceRequest(RHQ_DATASOURCE_NAME_XA, 30000, JDBC_DRIVER_ORACLE,
+                "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter", 15, 5, 50, 75,
+                RHQ_SECURITY_DOMAIN, "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker",
+                "TRANSACTION_READ_COMMITTED",
+                "org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker", props);
+        } else {
+            LOG.info("Oracle XA datasource [" + RHQ_DATASOURCE_NAME_XA + "] already exists");
+        }
+
+        if (noTxDsRequest != null || xaDsRequest != null) {
+            ModelNode batch = DatasourceJBossASClient.createBatchRequest(noTxDsRequest, xaDsRequest);
+            ModelNode results = client.execute(batch);
+            if (!DatasourceJBossASClient.isSuccess(results)) {
+                throw new FailureException(results, "Failed to create Oracle datasources");
+            }
         }
     }
 
@@ -977,4 +1018,26 @@ public class ServerInstallUtil {
             }
         }
     }
+
+    public static File getMarkerFile(String dir, String artifact, Marker marker) {
+        File markerFile = new File(dir, artifact + marker.getExtenstion());
+        return markerFile;
+    }
+
+    public static void touchMarkerFile(String dir, String artifact, Marker marker) throws Exception {
+        File markerFile = getMarkerFile(dir, artifact, marker);
+        markerFile.createNewFile();
+        markerFile.setLastModified(System.currentTimeMillis());
+    }
+
+    public static void deleteMarkerFile(String dir, String artifact, Marker marker) throws Exception {
+        File markerFile = getMarkerFile(dir, artifact, marker);
+        markerFile.delete();
+    }
+
+    public static boolean markerFileExists(String dir, String artifact, Marker marker) {
+        File markerFile = getMarkerFile(dir, artifact, marker);
+        return markerFile.exists();
+    }
+
 }
diff --git a/modules/enterprise/gui/installer/src/main/resources/org/rhq/enterprise/gui/installer/client/Messages.properties b/modules/enterprise/gui/installer/src/main/resources/org/rhq/enterprise/gui/installer/client/Messages.properties
index 19d5d2d..6ec5832 100644
--- a/modules/enterprise/gui/installer/src/main/resources/org/rhq/enterprise/gui/installer/client/Messages.properties
+++ b/modules/enterprise/gui/installer/src/main/resources/org/rhq/enterprise/gui/installer/client/Messages.properties
@@ -16,8 +16,9 @@ help_ssPublicAddress = This is the IP address or hostname that agents will use t
 help_ssServerName = This is a unique name to be assigned to this server. All servers must be assigned unique server names, however, they do not have to match the IP address or hostname of the server.
 help_testConnectionButton = You must confirm that your database settings are correct by pushing this button which tests the connection settings.
 message_formDidNotValidate = Please fix the errors before continuing.
-message_install_done = The installation has completed.
+message_install_doNotKnowIfInstalled = <p>A failure occurred when trying to determine if the server is already installed. The installer may not work properly. You should refresh this page to try again.</p>\nError: {0}\n
 message_install_failed = The installation failed.
+message_install_loginHere = <p><b>The server has been installed!</b></p>\n<p><a href="{0}">Click here to login to the server.</a></p>
 message_install_started = The installation has started . . . please wait.
 message_notValidBoolean = That is not a valid boolean (must be "true" or "false").
 message_notValidInteger = That is not a valid number.
diff --git a/modules/enterprise/gui/installer/src/test/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClientTest.java b/modules/enterprise/gui/installer/src/test/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClientTest.java
index 708b673..ed8c0c3 100644
--- a/modules/enterprise/gui/installer/src/test/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClientTest.java
+++ b/modules/enterprise/gui/installer/src/test/java/org/rhq/common/jbossas/client/controller/DatasourceJBossASClientTest.java
@@ -50,7 +50,11 @@ public class DatasourceJBossASClientTest {
         when(mcc.execute(any(ModelNode.class), any(OperationMessageHandler.class))).thenAnswer(new Answer<ModelNode>() {
             public ModelNode answer(InvocationOnMock invocation) throws Throwable {
                 System.out.println("~~~~~~~\n" + invocation.getArguments()[0]);
-                return mockSuccess;
+                ModelNode retNode = mockSuccess.clone();
+                ModelNode resultNode = retNode.get(JBossASClient.RESULT);
+                resultNode.get(DatasourceJBossASClient.DATA_SOURCE).setEmptyList();
+                resultNode.get(DatasourceJBossASClient.XA_DATA_SOURCE).setEmptyList();
+                return retNode;
             }
         });
 
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war.skipdeploy b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war.skipdeploy
deleted file mode 100644
index e69de29..0000000
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml
deleted file mode 100644
index 493bdbf..0000000
--- a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/jboss-web.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-
-<jboss-web>
-   <context-root>/installer</context-root>
-</jboss-web>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml
deleted file mode 100644
index c6bd385..0000000
--- a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/WEB-INF/web.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-         version="2.5">
-
-   <display-name>Post Installer Notification</display-name>
-   <description>Post Installer Notification</description>
-
-   <mime-mapping> 
-      <extension>jsf</extension> 
-      <mime-type>text/html</mime-type> 
-   </mime-mapping>
-
-   <welcome-file-list>
-      <welcome-file>/index.html</welcome-file>
-   </welcome-file-list>
-
-</web-app>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html
deleted file mode 100644
index 5da4047..0000000
--- a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>The Server Is Installed!</title>
-
-<meta http-equiv="Pragma"        content="no-cache" />
-<meta http-equiv="Expires"       content="-1" />
-<meta http-equiv="Cache-control" content="no-cache" />
-
-</head>
-<body>
-   <p>&nbsp;</p>
-   <h1 align="center">The Server Is Installed!</h1>
-   <p align="center"><a href="/coregui">Click here to get started!</a></p>
-</body>
-</html>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf
deleted file mode 100644
index 7463e8f..0000000
--- a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/start.jsf
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>The Server Is Installed!</title>
-
-</head>
-<body>
-   <p>&nbsp;</p>
-   <h1 align="center">The Server Is Installed!</h1>
-   <p align="center"><a href="/coregui">Click here to get started!</a></p>
-</body>
-</html>
diff --git a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf b/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf
deleted file mode 100644
index 7463e8f..0000000
--- a/modules/enterprise/server/appserver/src/main/resources/jbossas/standalone/deployments/rhq-postinstaller.war/welcome.jsf
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>The Server Is Installed!</title>
-
-</head>
-<body>
-   <p>&nbsp;</p>
-   <h1 align="center">The Server Is Installed!</h1>
-   <p align="center"><a href="/coregui">Click here to get started!</a></p>
-</body>
-</html>




More information about the rhq-commits mailing list