This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 685007

Summary: Update RemoteClientProxy to work with signed jars
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: CLIAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.0.0CC: ccrouch, hbrock, jsanda, lkrejci, snegrea
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 12:58:40 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 625146, 705059, 715334    

Description Charles Crouch 2011-03-14 23:23:29 EDT
Right now RemoteClientProxy.simplifyInterface() takes an interface class and tries to create a new class in the same package by appending the interface name with "Simple". When that interface is from a signed jar, loading the resulting class fails with an error similar to 

2011-03-14 18:34:45,497 ERROR [RHQ Client Prompt Input Thread]
(org.rhq.enterprise.client.RemoteClientProxy)- Failed to
simplify interface org.rhq.enterprise.server.auth.SubjectManagerRemote.
javassist.CannotCompileException: by java.lang.SecurityException: class
"org.rhq.enterprise.server.auth.SubjectManagerRe
moteSimple"'s signer information does not match signer information of other
classes in the same package
        at javassist.ClassPool.toClass(ClassPool.java:953)
        at javassist.ClassPool.toClass(ClassPool.java:896)
        at javassist.ClassPool.toClass(ClassPool.java:854)
        at javassist.CtClass.toClass(CtClass.java:1053)
        at
org.rhq.enterprise.client.RemoteClientProxy.simplifyInterface(RemoteClientProxy.java:146

RemoteClientProxy.simplifyInterface() appears to support recovering from such as errors, by returning the original interface, but as shown in https://bugzilla.redhat.com/show_bug.cgi?id=685003 that doesn't appear to work as expected.
Comment 1 Lukas Krejci 2011-03-15 11:21:26 EDT
Note that this has been the intended behaviour since introduction of CLI.

The RemoteClientProxy "simplifies" the remote interfaces by removing the Subject parameter from them. The JS client then actually uses these simplified interfaces to do the remote calls. The currently logged in user is used behind the scenes to automatically insert that parameter back when doing the actual remote call.

The fix here, I think, is to change the package the simplified interface is declared in.
Comment 2 Lukas Krejci 2011-03-15 11:23:42 EDT
Another note:

This method changed location in RHQ 4 codebase and is now declared in:

org.rhq.bindings.util.InterfaceSimplifier

in the modules/enterprise/binding module
Comment 3 Ian Springer 2011-05-16 16:39:01 EDT
Simplified interfaces now have a different package than the original interface. For example, the simplified interface for "org.rhq.enterprise.server.auth.SubjectManagerRemote" is now "org.rhq.enterprise.server.auth.wrapped.SubjectManagerRemoteSimple" - [master 40faf17].
Comment 4 Mike Foley 2011-05-24 16:31:15 EDT
to verify requires a jon build from brew (with signed jars)
Comment 9 Mike Foley 2011-09-06 12:47:12 EDT
verified JON3 Beta ... a build created with Brew and signed-jars...
Comment 11 Heiko W. Rupp 2013-09-03 12:58:40 EDT
Bulk closing of old issues that are in VERIFIED state.