Bug 535694 (RHQ-2363) - when an operation fails "gracefully", a stack trace is still returned to the Server and displayed in the GUI
Summary: when an operation fails "gracefully", a stack trace is still returned to the ...
Keywords:
Status: CLOSED NOTABUG
Alias: RHQ-2363
Product: RHQ Project
Classification: Other
Component: Operations
Version: 1.2
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: Ian Springer
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks: rhq_triage
TreeView+ depends on / blocked
 
Reported: 2009-08-17 18:16 UTC by Ian Springer
Modified: 2013-02-26 22:17 UTC (History)
2 users (show)

Fixed In Version: 1.4
Clone Of:
Environment:
Last Closed: 2013-02-26 22:17:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Ian Springer 2009-08-17 18:16:00 UTC
For an example, when the EAR/WAR Stop operation in the AS5 plugin fails gracefully, the following is displayed in the GUI:

java.lang.Exception: Operation 'start' on ResourceType[id=0, category=Service, name=EJB3 JAR, plugin=JBossAS5] Resource with key [vfszip:/C:/opt/jboss-eap-5.0.0-SNAPSHOT/server/all/deploy/EjbStatefulCounter.jar/] The resource is already started
        at org.rhq.core.pc.operation.OperationInvocation.run(OperationInvocation.java:278)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

Instead, just the message should be displayed, i.e.:

Operation 'start' on ResourceType[id=0, category=Service, name=EJB3 JAR, plugin=JBossAS5] Resource with key [vfszip:/C:/opt/jboss-eap-5.0.0-SNAPSHOT/server/all/deploy/EjbStatefulCounter.jar/] The resource is already started

This is occurring because of a limitation in the OperationServerService.API:

void operationFailed(String jobId, Configuration result, ExceptionPackage error, long invocationTime,
        long completionTime);

Note, the method provides no nice way to return a simple error message. You must either wrap the error message in an Exception (which is what the PC does in OperationInvocation.run()) or stick it in the result Configuration, which typically won't work because the operation result's ConfigurationDefinition might not provide a String property that can be used (e.g. the result type could even be void).

One way to fix this would be to add a new method to OperationServerService:

void operationFailed(String jobId, Configuration result, String errorMessage, long invocationTime,
        long completionTime);

or even just::

void operationFailed(String jobId, String errorMessage, long invocationTime,
        long completionTime);


Comment 1 Red Hat Bugzilla 2009-11-10 21:02:56 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2363


Comment 2 wes hayutin 2010-02-16 16:56:03 UTC
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.

keyword:
new = Tracking + FutureFeature + SubBug

Comment 3 wes hayutin 2010-02-16 17:01:12 UTC
making sure we're not missing any bugs in rhq_triage

Comment 4 Joseph Marques 2010-11-17 16:53:22 UTC
I think the methods we have today are sufficient.  If a plugin developers wants to catch this particular case (a resource is already in the started state and when the start operation is called), then they should return "success" as a result.  In other words, catch the stack trace and call operationSuccess(...) instead of operationFailed(...).  This will be done on a plugin-by-plugin basis, and as you pointed out needs to be done for the AS5 plugin.

Comment 5 Jay Shaughnessy 2013-02-26 22:17:06 UTC
I think this is no longer an issue.


Note You need to log in before you can comment on or make changes to this bug.