Bug 786194 - CLI interface simplifiers cause classloading exceptions in server when using non-default context classloader
Summary: CLI interface simplifiers cause classloading exceptions in server when using ...
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.3
Hardware: Unspecified
OS: Unspecified
unspecified vote
Target Milestone: ---
: RHQ 4.3.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
Depends On:
Blocks: 790018
TreeView+ depends on / blocked
Reported: 2012-01-31 17:12 UTC by Lukas Krejci
Modified: 2013-09-01 10:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-09-01 10:01:10 UTC

Attachments (Terms of Use)

Description Lukas Krejci 2012-01-31 17:12:35 UTC
Description of problem:
In the RHQ server, the CLI code can theoretically be invoked with different context classloaders. This obviously depends on the thread that invokes the code in question. It is generally not guaranteed that context classloader will be the same from invocation to invocation.

The interface simplifiers inside CLI generate custom classes on the fly and place them inside the context classloader. Such dynamically generated class is then used to generate a dynamic proxy that is configured to reside in the same classloader as the original interface.

Because the classloader of the original interface and the context classloader can be different, the creation of the dynamic proxy might fail because the dynamically created class will not be visible in the original classloader.

Version-Release number of selected component (if applicable):

How reproducible:
with difficulties

Steps to Reproduce:
1. checkout and build https://github.com/metlos/rhq-xmpp
2. Install the plugin into RHQ server
3. Configure it following the instructions in this video http://vimeo.com/35730049
4. Connect to the chat and try sending "var r = ProxyFactory.getResource(10001);"
Actual results:
IllegalArgumentException complaining about a class not being visible from classloader

Expected results:
CLI statements working as expected

Additional info:

Comment 1 Lukas Krejci 2012-01-31 18:12:57 UTC
master: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=c9cc6ed13db6d9d246611f627323abc86bd3f461
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Tue Jan 31 19:11:25 2012 +0100

    [BZ 786194] - Make sure to set the correct context classloader when
    simplifying the interfaces for the LocalClientProxy.

Comment 2 Charles Crouch 2012-02-13 04:39:47 UTC
Not quite sure how this ended up as CLOSED:UPSTREAM. Also it doesn't seem to have gone through a verification step so setting it back to ON_QA so it can be verified in master/RHQ4.3

Comment 3 Lukas Krejci 2012-02-13 14:31:42 UTC
Putting this under the correct tracker.

Comment 4 Heiko W. Rupp 2013-09-01 10:01:10 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.

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