Bug 604744

Summary: Clicking some of the sort columns in search results causes all values to disappear
Product: [Other] RHQ Project Reporter: Corey Welton <cwelton>
Component: Core UIAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: urgent    
Version: 1.4CC: jsanda
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:53:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 577210    

Description Corey Welton 2010-06-16 16:16:11 UTC
Description of problem:

When user enters some text into the provisioning search bar and begins clicking the column headers to sort, eventually all possible results disappear.  Furthermore, nothing else can be searched for anymore until user navigates away from gwt ui and back to it.

Hard to come up w/ a 100% heuristic for this, but I seem to be able to make it happen pretty regularly.

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


How reproducible:
Reasonably so, though steps are uncertain.

Steps to Reproduce:
1.  Administration > Content > Bundles.
2.  In the search box, enter the string 't' and wait for autocomplete
3.  Click the Description column header; wait for re-sort.
4.  Click the "Type" header;  note results.  
5.  Click Description again; note same results.
6.  Clear search terms and repeat steps 1-5
  
Actual results:
* If you are reasonably lucky, you will see that after clicking the "Type" header, you will be told there are no results and no matter what else you click, they do not return.
* If you are exceedingly lucky, or perhaps repeat these steps a few times, it seems that eventually nothing will come back in search.  User must navigate away from gwt ui and back to it, in order to use the search.

Expected results:

Search works.

Additional info:

Comment 1 Corey Welton 2010-07-06 16:00:49 UTC
Dev to see if this can be easily fixed and/or turn off the column sorting.

Comment 2 John Sanda 2010-07-08 14:12:35 UTC
I am able to consistently reproduce this when I first go into the GWT UI. After the first time, it is intermittent at best until I reload the UI. I get the following error in my server log,

2010-07-08 10:10:14,542 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/coregui]] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract org.rhq.core.domain.util.PageList org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTService.findResourcesByCriteria(org.rhq.core.domain.criteria.ResourceCriteria)' threw an unexpected exception: java.lang.RuntimeException: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: typeName of: org.rhq.core.domain.resource.Resource [SELECT resource
FROM org.rhq.core.domain.resource.Resource resource
WHERE ( resource.inventoryStatus = :inventoryStatus 
AND LOWER( resource.name ) like :name ESCAPE '\\'  )
ORDER BY resource.typeName ASC
]
	at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at org.rhq.enterprise.gui.coregui.server.gwt.AbstractGWTServiceImpl.service(AbstractGWTServiceImpl.java:61)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:124)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.RuntimeException: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: typeName of: org.rhq.core.domain.resource.Resource [SELECT resource
FROM org.rhq.core.domain.resource.Resource resource
WHERE ( resource.inventoryStatus = :inventoryStatus 
AND LOWER( resource.name ) like :name ESCAPE '\\'  )
ORDER BY resource.typeName ASC
]
	at org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl.findResourcesByCriteria(ResourceGWTServiceImpl.java:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
	... 27 more
Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: typeName of: org.rhq.core.domain.resource.Resource [SELECT resource
FROM org.rhq.core.domain.resource.Resource resource
WHERE ( resource.inventoryStatus = :inventoryStatus 
AND LOWER( resource.name ) like :name ESCAPE '\\'  )
ORDER BY resource.typeName ASC
]
	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
	at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
	at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
	at $Proxy305.findResourcesByCriteria(Unknown Source)
	at org.rhq.enterprise.gui.coregui.server.gwt.ResourceGWTServiceImpl.findResourcesByCriteria(ResourceGWTServiceImpl.java:111)
	... 32 more
Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: typeName of: org.rhq.core.domain.resource.Resource [SELECT resource
FROM org.rhq.core.domain.resource.Resource resource
WHERE ( resource.inventoryStatus = :inventoryStatus 
AND LOWER( resource.name ) like :name ESCAPE '\\'  )
ORDER BY resource.typeName ASC
]
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:616)
	at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
	at org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:134)
	at org.rhq.enterprise.server.util.CriteriaQueryGenerator.getQuery(CriteriaQueryGenerator.java:627)
	at org.rhq.enterprise.server.util.CriteriaQueryRunner.execute(CriteriaQueryRunner.java:62)
	at org.rhq.enterprise.server.resource.ResourceManagerBean.findResourcesByCriteria(ResourceManagerBean.java:2054)
	at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
	at org.rhq.enterprise.server.common.TransactionInterruptInterceptor.addCheckedActionToTransactionManager(TransactionInterruptInterceptor.java:77)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
	at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:156)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
	... 50 more
Caused by: org.hibernate.QueryException: could not resolve property: typeName of: org.rhq.core.domain.resource.Resource [SELECT resource
FROM org.rhq.core.domain.resource.Resource resource
WHERE ( resource.inventoryStatus = :inventoryStatus 
AND LOWER( resource.name ) like :name ESCAPE '\\'  )
ORDER BY resource.typeName ASC
]
	at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44)
	at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38)
	at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1362)
	at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:279)
	at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:386)
	at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:567)
	at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:241)
	at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:188)
	at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
	at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
	at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:728)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1216)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.orderExprs(HqlSqlBaseWalker.java:1545)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.orderClause(HqlSqlBaseWalker.java:1521)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:622)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
	at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
	at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
	at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
	at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
	at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
	at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
	at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
	at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
	at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
	at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
	... 76 more

Comment 3 John Sanda 2010-07-08 19:17:26 UTC
The column names are mapped to properties of the Resource class. The property names for type and category were wrong so when the criteria query is sent back to the server and translated into HQL it results in the exception above. I have corrected the property names for both the type and category fields.

commit hash: a9b4cf49b9fb2ba40ec4eae3bd116c389fc58bf8
             6fefb92216811c6a727e5bff0eb6de6872d0d2be

Comment 4 Corey Welton 2010-07-09 12:57:17 UTC
QA Verified.

Comment 5 Corey Welton 2010-08-12 16:53:38 UTC
Mass-closure of verified bugs against JON.