Bug 697484 - Column sorting exceptions (was Reports->Configuration History: Sorting on Ancestry column throws exception)
Column sorting exceptions (was Reports->Configuration History: Sorting on Anc...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
4.0.0
Unspecified Unspecified
high Severity medium (vote)
: ---
: ---
Assigned To: Jay Shaughnessy
Corey Welton
:
Depends On:
Blocks: rhq4
  Show dependency treegraph
 
Reported: 2011-04-18 08:40 EDT by Sunil Kondkar
Modified: 2011-05-23 21:09 EDT (History)
3 users (show)

See Also:
Fixed In Version: rhq4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-23 21:09:47 EDT
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 Sunil Kondkar 2011-04-18 08:40:42 EDT
Description of problem:

Clicking on on Ancestry column in Reports->Configuration History displays a message 'Unable to load configuration history' and throws below exception:

java.lang.RuntimeException:[1303129612489] javax.ejb.EJBException:java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ] -> java.lang.IllegalArgumentException:org.hibernate.QueryException: could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ] -> org.hibernate.QueryException:could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ]
--- STACK TRACE FOLLOWS ---
[1303129612489] javax.ejb.EJBException:java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ] -> java.lang.IllegalArgumentException:org.hibernate.QueryException: could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ] -> org.hibernate.QueryException:could not resolve property: resourceAncestry of: org.rhq.core.domain.configuration.ResourceConfigurationUpdate [SELECT resourceconfigurationupdate FROM org.rhq.core.domain.configuration.ResourceConfigurationUpdate resourceconfigurationupdate LEFT JOIN FETCH resourceconfigurationupdate.resource LEFT JOIN FETCH resourceconfigurationupdate.groupConfigurationUpdate LEFT JOIN FETCH resourceconfigurationupdate.configuration ORDER BY resourceconfigurationupdate.resourceAncestry ASC ]
    at Unknown.java_lang_RuntimeException_$RuntimeException__Ljava_lang_RuntimeException_2Ljava_lang_RuntimeException_2(Unknown source:0)
    at Unknown.com_google_gwt_user_client_rpc_core_java_lang_RuntimeException_1FieldSerializer_instantiate__Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_RuntimeException_2(Unknown source:0)
    at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.com_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_$readObject__Lcom_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
    at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
    at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown source:0)
    at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)
    at Unknown.anonymous(Unknown source:0)



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

Build#1144 (Version: 4.0.0-SNAPSHOT Build Number: 50f58a4)

How reproducible:

Always

Steps to Reproduce:

1. Login to RHQ.

2. Navigate to Reports->Subsystems->Configuration History.

3. Click on the 'Ancestry' columns to sort.

Actual results:

It displays a message 'Unable to load configuration history' and throws exception.


Expected results:

It should sort and should not throw the exception.


Additional info:
Comment 1 Charles Crouch 2011-04-18 19:46:14 EDT
Lets investigate. I'm concerned there could be something non-trivial going on with the Criteria Generator. If not then I'm fine with lowering priority on this
Comment 2 Jay Shaughnessy 2011-04-22 16:01:38 EDT
commit fbcfc50f1cacdf993c5608c65101dd46b36cf880
Author: Jay Shaughnessy <jshaughn@redhat.com>
Date:   Fri Apr 22 15:55:27 2011 -0400

    So actually, we're throwing exceptions all over the place on various column
    sorting.  This check-in fixes, I think, all columns for all of the report
    views.  Since several of those views use datasources common to other views
    many of these fixes will apply in various places. So that is good.

    But, I'm sure there are a lot of other places where we will still get hit.

    The trick is that it's not always obvious that there is a problem because
    if all of the data is held client-side (i.e. gwt has fetched all of the rows
    and is holding them client-side) then all rows will sort properly.  It's
    only when sorting is applied server-side that things blow up.

    So, when testing you must first visit the view. Then, select a column for
    sorting and *then* hit the refresh button.  This will force a server-side
    fetch with the sort applied.

    Note that even setting ListGridField.setCanSortClientSideOnly(true) is not
    solving the problem if applied to a field (although I think it should).

    In certain places I've added the necessary fields to as Criteria sort fields
    but this is not appropriate for every column. In other places I set the
    ListGridField name to match the necessary entity field name. In still other
    circumstances you can now perform the column-to-sort-field mapping in the
    datasource by overriding the new "getSortFieldForColumn(String columnName)"
    method. And by returning null you can ensure inappropriate fields do not
    make it to the server for sorting.

    - I may take out the calls to setCanSortClientOnly() as I'm not sure it buys
    us anything.
    - Also, I removed unused datasource field definition in a few places.

I'm going to look around some more before setting this to ON_QA but in short, when testing this I'd suggest trying to sort on just about everything you can think of for the standard list views, and use the refresh button technique described above.
Comment 3 Jay Shaughnessy 2011-04-22 22:00:01 EDT
more to do...

- group connection settings history, resource config history:
  date created
  last updated
  user

- group event
  details

- group op history
  requester

- users
  ldap login

- bundle version
  bundle files

- bundle destination
  group
  last deployed version
  last deployment date
  last deployment status
  

- bundle deployment
  bundle version
  deployment time
Comment 4 Jay Shaughnessy 2011-04-25 11:48:14 EDT
commit 6fbf997eafe746e2a493fe020b22f81c3fd48b78
Author: Jay Shaughnessy <jshaughn@redhat.com>
Date:   Mon Apr 25 11:46:19 2011 -0400

all of the documented columns should now be ok.
Comment 5 Mike Foley 2011-04-27 09:09:16 EDT
retested sorting of all columns in reports/subsystem/configuration history.  reviewd log files for any silent failures with sql or the criteria generator
Comment 6 Corey Welton 2011-05-23 21:09:47 EDT
Bookkeeping - closing bug - fixed in recent release.

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