Bug 601214 - AS 5 plugin: Service Bindings DOWN in one server but UP for another - classloading problem
AS 5 plugin: Service Bindings DOWN in one server but UP for another - classlo...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All All
urgent Severity medium (vote)
: ---
: ---
Assigned To: John Mazzitelli
Lukas Krejci
:
Depends On:
Blocks: 725852 jon24-ewp
  Show dependency treegraph
 
Reported: 2010-06-07 09:42 EDT by Heiko W. Rupp
Modified: 2011-07-27 11:04 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:58:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2010-06-07 09:42:34 EDT
I am running EAP 5.0.1 servers

-b <eth0> -c web
default
- b <tun0> -c production

default shows all port-xx configs below the SBM as up
web shows all port-xx configs below the SBM as down
production shows no port-xx below the SBM at all

Server is on RHEL 5.5 , sun jdk, PG 8.4
Comment 1 Charles Crouch 2010-06-08 10:55:37 EDT
Is this related to JOPR-339?
Comment 2 Filip Drabek 2010-07-08 11:21:04 EDT
I can reproduce the situation. The ServiceBindingManager is accessible via Profile services, BindingSets are also loaded. Problem must be in AS5 plugin.
Comment 3 Filip Drabek 2010-07-08 13:36:37 EDT
I'm getting classcast exception org.rhq.plugins.jbossas5.serviceBinding.ManagerComponent cannot be cast to org.rhq.plugins.jbossas5.serviceBinding.ManagerComponent when running this code 

String bindingSetName = context.getParentResourceComponent().getBindingSetNameFromResourceKey(
            context.getResourceKey());
in SetComponent class. 

/ this exception is thrown when the server is started with params -b <addr> -c web when the server is started with params -b <addr> -c default everything works fine/
Comment 4 Filip Drabek 2010-07-09 12:28:16 EDT
Parent resource of SetComponent is ServiceBindingManager which is singleton. 
SetComponents resources has for all EAP instances the same names(and keys) ports-01, ports-02, ports-03 and ports-default.

When the code from my previous comment is called current component classloader is classloader of ports-01 resource from "default" EAP server and the parent component classloader is ServiceBindingManager's resource classloader from "production" EAP server.

When I have two EAP servers in inventory and I call operation "Retrieve ClassLoader Information For All Resources" on Agent Plugin Container resource I have in the list of classloaders only one classloader for ports-01 etc..

It is the same for JBossWeb - Connectors components. When I have two eap servers :
./run.sh -b 10.0.0.253 -c default
./run.sh -b 10.0.0.253 -c production
connectors ajp://10.0.0.253:8009 and http://10.0.0.253:8080 are still Down (they have the same name for both instances, connectors with different names has separate classloaders). /there is again only one classloader/
Comment 5 John Mazzitelli 2010-07-09 13:37:58 EDT
looks like the canonical IDs used to identify a resource for knowing which classloader to use isn't as canonical as I thought :)

I looks like the "port-N" resources along with their singleton parents are not producing unique enough IDs used by the ClassLoaderManager. So it looks like the port-N resources for both EAP servers are resulting in the same hashcode lookup and thus one wins and the other loses (the loser resource gets the winner resource's classloader).

I'm gonna take this BZ and see if I can fix this. I know the code involved here.
Comment 6 John Mazzitelli 2010-07-09 13:43:34 EDT
the source of the problem I think is in the implementation of:

org.rhq.core.pc.plugin.CanonicalResourceKey

I was taking the resource keys of the resource itself and its parent, but we are down several levels deep and the parent key is that of the service binding manager resource which is a singleton and has a very basic key that is not unique across servers (which is fine, this is allowed - this canonical resource key stuff just doesn't take this into account)
Comment 7 John Mazzitelli 2010-07-09 13:46:21 EDT
i believe this problem was introduced when the fix to bug 551056 went in
Comment 8 John Mazzitelli 2010-07-09 16:09:38 EDT
release-3.0.0 branch commit: 0cb1c2429d8315e98d1ca264c51d06877159722e

needed to get that CanonicaResourceKey class look up the entire hierarchy, rather than just one level up (the direct parent). This now works on my box.

How to replicate:

1) Start two instances of EAP 5.0.1
2) Start agent and import both EAP instances
3) Confirm the Service Binding Manager and their children for both EAP instances are green (aka UP)
Comment 9 Lukas Krejci 2010-07-14 12:02:47 EDT
QA Verified.
Comment 10 Corey Welton 2010-08-12 12:58:15 EDT
Mass-closure of verified bugs against JON.
Comment 11 Ian Springer 2011-07-27 11:04:56 EDT
This fix is included in the RHQ branch used for EAP 5.1.x admin-console releases.

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