Bug 601214 - AS 5 plugin: Service Bindings DOWN in one server but UP for another - classloading problem
Summary: AS 5 plugin: Service Bindings DOWN in one server but UP for another - classlo...
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins   
(Show other bugs)
Version: 3.0.0
Hardware: All
OS: All
medium vote
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Lukas Krejci
Depends On:
Blocks: 725852 jon24-ewp
TreeView+ depends on / blocked
Reported: 2010-06-07 13:42 UTC by Heiko W. Rupp
Modified: 2011-07-27 15:04 UTC (History)
4 users (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-08-12 16:58:15 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Heiko W. Rupp 2010-06-07 13:42:34 UTC
I am running EAP 5.0.1 servers

-b <eth0> -c web
- 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 14:55:37 UTC
Is this related to JOPR-339?

Comment 2 Filip Drabek 2010-07-08 15:21:04 UTC
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 17:36:37 UTC
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(
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 16:28:16 UTC
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 -c default
./run.sh -b -c production
connectors ajp:// and 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 17:37:58 UTC
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 17:43:34 UTC
the source of the problem I think is in the implementation of:


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 17:46:21 UTC
i believe this problem was introduced when the fix to bug 551056 went in

Comment 8 John Mazzitelli 2010-07-09 20:09:38 UTC
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 16:02:47 UTC
QA Verified.

Comment 10 Corey Welton 2010-08-12 16:58:15 UTC
Mass-closure of verified bugs against JON.

Comment 11 Ian Springer 2011-07-27 15:04:56 UTC
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.