Bug 601880 - JBossAS5 Plugin - ApplicationServerOperationsDelegate uses old plugin configuration after plugin configuration was updated.
JBossAS5 Plugin - ApplicationServerOperationsDelegate uses old plugin configu...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All Linux
urgent Severity medium (vote)
: ---
: ---
Assigned To: Filip Drabek
Corey Welton
:
Depends On:
Blocks: 725852 jon24-eap jon-sprint11-bugs
  Show dependency treegraph
 
Reported: 2010-06-08 15:49 EDT by Filip Drabek
Modified: 2011-07-26 17:35 EDT (History)
4 users (show)

See Also:
Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 12:54:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Filip Drabek 2010-06-08 15:49:16 EDT
Description of problem:
ApplicationServerOperationsDelegate is created in ApplicationServerComponent only once and than is only reused. When plugin configuration is updated ApplicationServerOperationsDelegate will still work with the old configuration which is stored in ApplicationServerOperationsDelegate classes private property and updated only in creation time.
Comment 1 Ian Springer 2010-06-08 17:19:26 EDT
Just to state the obvious, the fix is to (non-lazily!) create (or recreate) the operations delegate in the start() method, rather than lazily creating it in invokeOperation() as is currently being done.
Comment 2 Filip Drabek 2010-06-16 10:14:57 EDT
commit 687cb82196f410a5b512c5f7c69da6e85c5bb3cb
Comment 3 Corey Welton 2010-06-22 08:43:26 EDT
Do we have environment and/or repro steps for this?  I wasn't able to determine what exactly caused the failure.
Comment 4 Filip Drabek 2010-06-25 13:46:41 EDT
Repro steps:

1) Install RHQ server and agent. 
2) Discover and import some EAP5 server to rhq.
3) Turn off the EAP5 server
4) Change property javaHome in EAP5 server configuration(Inventory - Connection) to some non existing path.
5) Start operation "start" on EAP5 server resource component.
6) check if the server is running.
  - if the server is running the bug still occures.
  - if the server is not running the bug is fixed.

Do not restart plugin container during this test.
Comment 5 Corey Welton 2010-06-25 17:41:07 EDT
Sending this back to dev... something weird is going on, not sure if it is related or not. 

I inventoried an eap5 server.  Stopped it, and then when I went into Connection > Properties, I noticed the javaHome field was empty.  I thought that was strange.  In any case, I changed the value to "/tmp", figuring that would fail.

I went to run the start op, and got the following message:


java.lang.IllegalStateException: The 'javaHome' connection property must be set in order to start the application server or to stop it via script.
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.initProcessExecution(ApplicationServerOperationsDelegate.java:284)
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.start(ApplicationServerOperationsDelegate.java:230)
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.invoke(ApplicationServerOperationsDelegate.java:142)
        at org.rhq.plugins.jbossas5.ApplicationServerComponent.invokeOperation(ApplicationServerComponent.java:495)
        at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)

Not sure if this was what i was expecting or not, I went back and cleared the field, i.e., returning it to the state it initially occupied.  I then tried to start server again.  Failed with the same message:


Close Window
java.lang.IllegalStateException: The 'javaHome' connection property must be set in order to start the application server or to stop it via script.
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.initProcessExecution(ApplicationServerOperationsDelegate.java:284)
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.start(ApplicationServerOperationsDelegate.java:230)
        at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.invoke(ApplicationServerOperationsDelegate.java:142)
        at org.rhq.plugins.jbossas5.ApplicationServerComponent.invokeOperation(ApplicationServerComponent.java:495)
        at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)

Finally, I set the javaHome to "/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/", and attempted to restart the server.

Again, got the same error when executing the op

Close Window
java.lang.IllegalStateException: The 'javaHome' connection property must be set in order to start the application server or to stop it via script.
	at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.initProcessExecution(ApplicationServerOperationsDelegate.java:284)
	at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.start(ApplicationServerOperationsDelegate.java:230)
	at org.rhq.plugins.jbossas5.ApplicationServerOperationsDelegate.invoke(ApplicationServerOperationsDelegate.java:142)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.invokeOperation(ApplicationServerComponent.java:495)
	at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)


So I think something is pretty wrong here.  I am not sure if this bz is the same root cause, but at very least it is keeping me from running this test cleanly -- and from running the start op at all, regardless of whatever I set javaHome to be.
Comment 7 Rajan Timaniya 2010-07-02 06:34:41 EDT
Verified on JON 2.4 GA_QA  (tag-jon-release  build# 49)
Revision: 10771

Steps:
1) Install RHQ server and agent. 
2) Discover and import some EAP5 server to rhq.
3) Turn off the EAP5 server
4) Change property javaHome in EAP5 server configuration(Inventory -
Connection) to some non existing path.
5) Start operation "start" on EAP5 server resource component.
6) check if the EAP5 server shows running.

Observation:
EAP5 server shows running with wrong 'Java Home'.
Comment 8 Filip Drabek 2010-07-07 17:28:18 EDT
Please test it on RHQ-3.0.0 release. (The fix is in master branch and release-3.0.0 branch)
Comment 9 Sudhir D 2010-07-13 07:34:31 EDT
Tested on rhq build rhq-enterprise-agent-4.0.0-SNAPSHOT. After updating the JAVA_HOME in connection properties, the service still show up.

I shall test this against rhq-server-3.0.0.GA_QA.zip
Comment 10 Corey Welton 2010-07-16 14:45:19 EDT
QA Verified against latest nightly.  Changing the javahome value to "/tmpnothing" causes the start op to fail as expecting it.  Furthermore, changing it back to something normal, i.e., "/usr/lib/jvm/jre-1.6.0-openjdk.x86_64" allows it to work.
Comment 11 Corey Welton 2010-08-12 12:54:23 EDT
Mass-closure of verified bugs against JON.
Comment 12 Ian Springer 2011-07-26 17:35:03 EDT
Note, the fix for this issue is already present in the AdminConsole_EAP_5_1 branch, since it got checked in prior to the RHQ 3.0.0.GA tag, which is what AdminConsole_EAP_5_1 branched from. This means the fix is also present in EAP 5.x admin-consoles, though it's not clear to me if it would even make a difference in the context of the admin-console, which provides no way for a user to edit a resource's plugin config.

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