modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 7 +++++-- modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java | 2 ++ modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java | 1 + 3 files changed, 8 insertions(+), 2 deletions(-)
New commits: commit c69f86e8c6d6674db90419751eb4daeaa62eac49 Author: Lukas Krejci lkrejci@redhat.com Date: Fri Feb 3 13:13:18 2012 +0100
[BZ 773661] - Reporting invalid plugin configuration if the resource starts failing startup after upgrade and after manual add of a resource.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 98310a1..eaee690 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -795,6 +795,7 @@ public class InventoryManager extends AgentService implements ContainerService, performServiceScan(resource.getId());
if (null != startError) { + handleInvalidPluginConfigurationResourceError(resource, startError); throw new PluginContainerException("The resource [" + resource + "] has been added but could not be started. Verify the supplied configuration values: ", startError); @@ -1657,7 +1658,7 @@ public class InventoryManager extends AgentService implements ContainerService, * @param t the exception that indicates the problem with the plugin configuration * @return true if the error was sent successfully, or false otherwise */ - private boolean handleInvalidPluginConfigurationResourceError(Resource resource, Throwable t) { + public boolean handleInvalidPluginConfigurationResourceError(Resource resource, Throwable t) { resource.setConnected(false); // invalid plugin configuration infers the resource component is disconnected // Give the server-side an error message describing the connection failure that can be // displayed on the resource's Inventory page. @@ -2872,4 +2873,4 @@ public class InventoryManager extends AgentService implements ContainerService, // nothing to do } } -} \ No newline at end of file +} diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java index c32ca97..ffd2065 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/upgrade/ResourceUpgradeDelegate.java @@ -217,8 +217,10 @@ public class ResourceUpgradeDelegate { inventoryManager.activateResource(resource, container, true); } catch (InvalidPluginConfigurationException e) { log.debug("Resource [" + resource + "] failed to start up after upgrade.", e); + inventoryManager.handleInvalidPluginConfigurationResourceError(resource, e); } catch (Throwable t) { log.error("Failed to activate the resource [" + resource + "] after upgrade.", t); + inventoryManager.handleInvalidPluginConfigurationResourceError(resource, t); } } }
commit c5622ffb62e3f568d01975aa7eba6d1bfee301fe Author: Lukas Krejci lkrejci@redhat.com Date: Fri Feb 3 13:15:05 2012 +0100
[BZ 773661] - The security exception is thrown directly if the principal is null but wrapped in another exception if the principal is non-null. Report both instances as InvalidPluginConfigurationExceptions while connecting to profile service.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java index 299bdcd..804657c 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java @@ -371,6 +371,7 @@ public class ApplicationServerComponent<T extends ResourceComponent<?>> implemen this.connection = connectionProvider.connect(); } catch (RuntimeException e) { Throwable rootCause = ExceptionUtils.getRootCause(e); + rootCause = rootCause == null ? e : rootCause; if (rootCause instanceof SecurityException) { if (log.isDebugEnabled()) { log.debug("Failed to connect to Profile Service.", e);
commit 458626ace44e55ebe9c88c00cdacadb6856a8dec Author: Lukas Krejci lkrejci@redhat.com Date: Fri Feb 3 13:34:21 2012 +0100
[BZ 773661] - Invalid plugin configuration errors are now reported also during the InventoryManager start up.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 51ad1b7..98310a1 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -2831,8 +2831,10 @@ public class InventoryManager extends AgentService implements ContainerService, } } catch (InvalidPluginConfigurationException e) { log.debug("Failed to activate resource [" + resource + "] due to invalid plugin configuration.", e); + handleInvalidPluginConfigurationResourceError(resource, e); } catch (Throwable t) { log.error("Exception thrown while activating [" + resource + "].", t); + handleInvalidPluginConfigurationResourceError(resource, t); } } }
rhq-commits@lists.fedorahosted.org