modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java
| 3 ++-
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, 5 insertions(+), 1 deletion(-)
New commits:
commit 9e6d06064faf01d9380fad64c91525e7b228c3bf
Author: Lukas Krejci <lkrejci(a)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 e732f44351125a591582dbd2ee59f983eb7eb300
Author: Lukas Krejci <lkrejci(a)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 ab4ecbc..c39f6f2 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
@@ -797,6 +797,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);
@@ -1684,7 +1685,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.
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);
}
}
}
Show replies by date