Bug 902823 - Nonsense data returned as backing content of non-content-backed resources
Summary: Nonsense data returned as backing content of non-content-backed resources
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Content
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.6
Assignee: Jirka Kremser
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-22 13:29 UTC by Lukas Krejci
Modified: 2013-09-03 14:42 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-03 14:42:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2013-01-22 13:29:06 UTC
Description of problem:
Have a resource that can discover some content but is not in itself a content-backed resource (for example a JBoss AS 4 server, that can discover the jar files in its lib).

In CLI, call:

var id = <ID OF THE AS4 RESOURCE>
var content = ContentManager.getBackingContentForResource(id)

Version-Release number of selected component (if applicable):
4.6.0-SNAPSHOT (but the code has been incorrect since forever, with the last change to the behavior on 5th Jan 2012)

How reproducible:
always

Steps to Reproduce:
1. Wait for the content of the AS4 resource to be discovered (takes a while after it is imported to the inventory)
2. In CLI, call:

var id = <ID OF THE AS4 RESOURCE>
var content = ContentManager.getBackingContentForResource(id)

Actual results:

The content variable is non-null and contains an instance of "InstalledPackage" object pointing to one of the "jars" discovered inside the AS4 server.
  
Expected results:
The method should probably throw an exception complaining that AS4 server is not a content backed resource.

Additional info:

Comment 1 Jirka Kremser 2013-02-06 13:58:09 UTC
master
http://bugzilla.redhat.com/show_bug.cgi?id=77d64e830

time:    Wed Feb 6 14:53:28 2013 +0100
commit:  77d64e8302bfe3b1df0c5e209ab7a203b10dd589
author:  Jirka Kremser - jkremser
message: [BZ 902823 - Nonsense data returned as backing content of non-content-backed resources] The UnsupportedOperationException is thrown when the resource is non-content-backed. I was checking also the usages of the method and it seems to be ok.

Comment 2 Jirka Kremser 2013-02-06 13:59:33 UTC
the link ^^ should be http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=77d64e830

Comment 3 Jirka Kremser 2013-02-12 16:13:50 UTC
master
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=c7199465b

time:    Tue Feb 12 17:06:56 2013 +0100
commit:  c7199465b2ab8bf9cd253fdffcc278577d557a7a
author:  Jirka Kremser - jkremser
message: [BZ 902823 - Nonsense data returned as backing content of non-content-backed resources] Instead of throwing the exception, the null is returned. Now it's in compliance w/ the the method's jdoc.

Comment 4 Heiko W. Rupp 2013-09-03 14:42:05 UTC
Bulk closing of issues in old RHQ releases that are in production for a while now.

Please open a new issue when running into an issue.


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