Bug 759173 - updateBackingContent and retrieveBackingContent Not Available for WAR Resources for Tomcat
updateBackingContent and retrieveBackingContent Not Available for WAR Resourc...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
4.3
Unspecified Unspecified
high Severity unspecified (vote)
: ---
: RHQ 4.3.0,JON 3.0.0
Assigned To: Mike Foley
Mike Foley
:
Depends On:
Blocks: jon30-sprint9
  Show dependency treegraph
 
Reported: 2011-12-01 10:35 EST by Stefan Negrea
Modified: 2012-03-23 12:03 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-07 14:17:18 EST
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 Stefan Negrea 2011-12-01 10:35:11 EST
Description of problem:
updateBackingContent and retrieveBackingContent not available for WAR resources for Tomcat servers from the CLI.

How reproducible:
Every time with JON CR4.

Steps to Reproduce:
1. Start the CLI and connect to RHQ server.
2. Locate an web-app for a Tomcat Server (in this example 10163)
2. Run the following commands:
 a. webapp = ProxyFactory.getResource(10163) (replace with a good resource id for your system)
 b. webapp.retrieveBackingContent("/path/to/valid/backupsample.war")
 c. webapp.updateBackingContent("/path/to/valid/sample.war")
  
Actual results:
TypeError: Cannot find function retrieveBackingContent. 
webapp.retrieveBackingContent(...

Expected results:
The commands succeed.

Additional info:
When the methods are invoked from cli scripts the following error is displayed:

sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot find function retrieveBackingContent. (<Unknown source>#70) in <Unknown source> at line number 70
Comment 1 Stefan Negrea 2011-12-01 14:18:41 EST
This problem does not occur on master branch for RHQ using a dev build. However, it can be consistently replicated with JON CR4.
Comment 2 Mike Foley 2011-12-01 15:40:16 EST
understanding the root cause here is key ... to make sure the CLI remote download jar is built and packaged properly.
Comment 3 Mike Foley 2011-12-01 17:59:43 EST
signing issue in rhq-remoting-cli-4.2.0.JON300.CR4
Comment 4 John Mazzitelli 2011-12-01 18:28:56 EST
master commit: 2b26d44
release_jon3.x commit: 7f116a1

this renames the org.rhq.enterprise.client package to
org.rhq.enterprise.clientapi package in the module:
/rhq/modules/enterprise/remoting/client-api
Comment 5 Mike Foley 2011-12-01 18:45:10 EST
QE verification to be done by Mike (I am familiar with the failure and repro steps ...)  assigning to myself for verification.  

note: to be verified in CR5 build from Brew.
Comment 6 Charles Crouch 2011-12-02 08:58:25 EST
Just to document the analysis that was done:

In CR4 it was found that removing the signing metadata from the 
rhq-script-bindings-4.2.0.JON300.CR4.jar, which is part of the CLI bundle, 
resolved the issue.

Jay found duplicate packages in multiple jars, which mazz rectified with his 
fix, which had led to an issue similar to this one in the past. The idea is 
that by removing the occurence of duplicate packages it will resolve the issue 
without the need to remove the signing on the 
rhq-script-bindings-4.2.0.JON300.CR4.jar. Mike will confirm whether this is the 
case as soon as CR5 is available.
Comment 7 Mike Foley 2011-12-02 10:35:30 EST
I have tested as follows:
1) installed CR5
2) installed AS7 plugin
3) disovered and imported my EAP6 server
4) identified the resource of my deployed .war ... which is resource id = 10048
5) last night ... using signed and unsigned jars ... i saw the correct and incorrect behavior
6) below documents the behavior I am seeing with CR5 ... which is not correct ... doing some additional verification.


[mfoley@foleymonsterbox1 CLI]$ cd rhq-remoting-cli-4.2.0.JON300.CR5
[mfoley@foleymonsterbox1 rhq-remoting-cli-4.2.0.JON300.CR5]$ cd bin
[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin
RHQ - RHQ Enterprise Remote CLI 4.2.0.JON300.CR5
Remote server version is: 3.0.0.CR5 (ff485f2:fd398e2)
Login successful
rhqadmin@localhost:7080$ webapp = ProxyFactory.getResource(10048)
ResourceClientProxy:
	          id: 10048
	        name: helloworld.war
	     version: 
	resourceType: Deployment

rhqadmin@localhost:7080$ webapp.

children         contentTypes     createdDate      description
getChild         getMeasurement   id               measurements
modifiedDate     name             operations       resourceType
toString         version
rhqadmin@localhost:7080$ webapp.
Comment 8 Mike Foley 2011-12-02 10:40:23 EST
additional testing as follows: i removed the signing files from the remoting .jar file ... and re-performed the same test.  Now I see the correct behavior ..ie ... the methods retrieveBackingContent and updateBackingContent now display with autocomplete.  this confirms is not fixed yet.  


[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin
RHQ - RHQ Enterprise Remote CLI 4.2.0.JON300.CR5
Remote server version is: 3.0.0.CR5 (ff485f2:fd398e2)
Login successful
rhqadmin@localhost:7080$ webapp = ProxyFactory.getResource(10048)
ResourceClientProxy_$$_javassist_0:
	               backingContent: 
	                     children: 
	                 contentTypes: {file=File}
	                  createdDate: Fri Dec 02 10:24:28 EST 2011
	                  description: 
	                      handler: 
	                           id: 10048
	                 measurements: []
	                 modifiedDate: Fri Dec 02 10:24:28 EST 2011
	                         name: helloworld.war
	                   operations: []
	          pluginConfiguration: 
	pluginConfigurationDefinition: ConfigurationDefinition[id=10209, name=Deployment]
	                 resourceType: Deployment
	                      version: 

rhqadmin@localhost:7080$ webapp.

backingContent                  children
contentTypes                    createdDate
description                     editPluginConfiguration
getChild                        getMeasurement
id                              measurements
modifiedDate                    name
operations                      pluginConfiguration
pluginConfigurationDefinition   resourceType
retrieveBackingContent          toString
updateBackingContent            updatePluginConfiguration
version
rhqadmin@localhost:7080$ webapp.
Comment 9 Mike Foley 2011-12-02 10:45:02 EST
documenting the exception i see with CR5 in the CLI's log file

2011-12-02 10:25:24,478 ERROR [RHQ Client Prompt Input Thread] (org.rhq.bindings.client.ResourceClientFactory)- Could not create custom interface for resource with id 10048
javassist.CannotCompileException: by java.lang.SecurityException: class "org.rhq.bindings.client.ResourceClientProxy5bc8d4d1a9859af5aab6a918a6d1029f0a8754cc60136a74fe735ef34d2ff4f1"'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.bindings.client.ResourceClientFactory.defineCustomInterface(ResourceClientFactory.java:202)
	at org.rhq.bindings.client.ResourceClientFactory.getResource(ResourceClientFactory.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at sun.org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
	at sun.org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
	at sun.org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
	at sun.org.mozilla.javascript.gen.c297._c0(<Unknown source>:1)
	at sun.org.mozilla.javascript.gen.c297.call(<Unknown source>)
	at sun.org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
	at sun.org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
	at sun.org.mozilla.javascript.gen.c297.call(<Unknown source>)
	at sun.org.mozilla.javascript.gen.c297.exec(<Unknown source>)
	at sun.org.mozilla.javascript.Context.evaluateReader(Context.java:1135)
	at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:123)
	at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:149)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:149)
	at org.rhq.enterprise.client.ClientMain.executePromptCommand(ClientMain.java:317)
	at org.rhq.enterprise.client.ClientMain$1.run(ClientMain.java:262)
	at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.SecurityException: class "org.rhq.bindings.client.ResourceClientProxy5bc8d4d1a9859af5aab6a918a6d1029f0a8754cc60136a74fe735ef34d2ff4f1"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:787)
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:502)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:628)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:480)
	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at javassist.ClassPool.toClass2(ClassPool.java:965)
	at javassist.ClassPool.toClass(ClassPool.java:947)
	... 26 more
Comment 10 Charles Crouch 2011-12-02 11:04:02 EST
So this may well be the best option to resolve the issue currently.


(9:47:00 AM) ccrouch: spinder: so can you work with mikeb around unsigning/not signing a particular jar
(9:47:30 AM) spinder: ccrouch: I can ping mikeb to see what that will mean and how difficult. 
(9:47:58 AM) mikeb: spinder: you can skip signing for a particular jar by passing a property to MEAD at build-time
(9:48:28 AM) mikeb: spinder: -Dmavensign.sign.skip=foo.jar
(9:48:28 AM) spinder: mikeb: nice. Is there a link on how that process should work?
(9:48:41 AM) mikeb: spinder: it was posted to mead-list a couple weeks ago
(9:49:25 AM) mikeb: spinder: subject: MEAD signing enhancements
Comment 11 Mike Foley 2011-12-03 20:26:31 EST
documenting the verification with JON 3 GA

[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin
RHQ - RHQ Enterprise Remote CLI 4.2.0.JON300.GA
Remote server version is: 3.0.0.GA (e23441b:4e746e8)
Login successful
rhqadmin@localhost:7080$ webapp = ProxyFactory.getResource(10048)
ResourceClientProxy_$$_javassist_0:
	               backingContent: 
	                     children: 
	                 contentTypes: {file=File}
	                  createdDate: Fri Dec 02 10:24:28 EST 2011
	                  description: 
	                      handler: 
	                           id: 10048
	                 measurements: []
	                 modifiedDate: Fri Dec 02 10:24:28 EST 2011
	                         name: helloworld.war
	                   operations: []
	          pluginConfiguration: 
	pluginConfigurationDefinition: ConfigurationDefinition[id=10209, name=Deployment]
	                 resourceType: Deployment
	                      version: 

rhqadmin@localhost:7080$ webapp.

backingContent                  children
contentTypes                    createdDate
description                     editPluginConfiguration
getChild                        getMeasurement
id                              measurements
modifiedDate                    name
operations                      pluginConfiguration
pluginConfigurationDefinition   resourceType
retrieveBackingContent          toString
updateBackingContent            updatePluginConfiguration
version
rhqadmin@localhost:7080$ webapp.
Comment 12 Mike Foley 2011-12-06 10:41:42 EST
re-verified in JON 3 GA #2
Comment 13 Mike Foley 2012-02-07 14:17:18 EST
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE

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