Bug 685007 - Update RemoteClientProxy to work with signed jars
Update RemoteClientProxy to work with signed jars
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
4.0.0
Unspecified Unspecified
urgent Severity urgent (vote)
: ---
: ---
Assigned To: Charles Crouch
Mike Foley
:
Depends On:
Blocks: jon30-bugs jon3-sprint1 715334
  Show dependency treegraph
 
Reported: 2011-03-14 23:23 EDT by Charles Crouch
Modified: 2015-02-01 18:26 EST (History)
5 users (show)

See Also:
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:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
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.

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