Bug 565626 - RHQ main menu Groups > Search: > searchItem throws error
Summary: RHQ main menu Groups > Search: > searchItem throws error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core UI
Version: 1.4
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: rhq_spearhead
TreeView+ depends on / blocked
 
Reported: 2010-02-15 19:07 UTC by John Sefler
Modified: 2010-08-12 16:57 UTC (History)
4 users (show)

Fixed In Version: 2.4
Clone Of:
Environment:
Last Closed: 2010-08-12 16:57:48 UTC
Embargoed:


Attachments (Terms of Use)
screenshot after clicking on the retrieve search item in the ajaxy pop-up menu (186.86 KB, application/octet-stream)
2010-02-15 19:15 UTC, John Sefler
no flags Details

Description John Sefler 2010-02-15 19:07:56 UTC
Description of problem:

Attempts to use the main menu Groups > Search text box to search for a valid existing group is throwing an exception after clicking the ajaxy search item.

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

How reproducible:


Steps to Reproduce:
1. create a valid mixed group with name foo
2. click the main menu Groups
3. type foo in the Search: text field
4. wait a second for the ajaxy loading of the pop-up menu item with foo listed
5. click on foo
  
Actual results:
An Error Occurred:
/rhq/group/layout/main.xhtml @33,137 template="${(ResourceGroupUIBean.compatible) ? '/rhq/entity/layout/main.xhtml' : '/rhq/entity/layout/main-wide.xhtml'}" Cant instantiate class: org.rhq.enterprise.gui.inventory.group.ResourceGroupUIBean.


- Stack Trace

com.sun.facelets.tag.TagAttributeException: /rhq/group/layout/main.xhtml @33,137 template="${(ResourceGroupUIBean.compatible) ? '/rhq/entity/layout/main.xhtml' : '/rhq/entity/layout/main-wide.xhtml'}" Cant instantiate class: org.rhq.enterprise.gui.inventory.group.ResourceGroupUIBean.
	at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
	at com.sun.facelets.tag.TagAttribute.getValue(TagAttribute.java:200)
	at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
	at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
	at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
....


- Component Tree

<AjaxViewRoot id="_viewRoot" immediate="false" locale="en" renderKitId="HTML_BASIC" renderRegionOnly="false" rendered="true" selfRendered="false" submitted="false" transient="false" viewId="/rhq/group/inventory/view.xhtml"/>




Expected results:
The foo group should be opened up for viewing.

Additional info:
detected by existing automated GUI test.

Comment 1 John Sefler 2010-02-15 19:15:58 UTC
Created attachment 394379 [details]
screenshot after clicking on the retrieve search item in the ajaxy pop-up menu

Comment 2 wes hayutin 2010-02-16 16:57:27 UTC
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.

keyword:
new = Tracking + FutureFeature + SubBug

Comment 3 wes hayutin 2010-02-16 17:02:32 UTC
making sure we're not missing any bugs in rhq_triage

Comment 4 Adam Young 2010-02-25 22:03:47 UTC
This is the root cause stack trace:

org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
  Position: 2489
	org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
	org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
	org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
	org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
	org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
	sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:455)
	$Proxy48.executeQuery(Unknown Source)
	org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
	org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
	org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:187)
	org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
	org.hibernate.loader.Loader.doQuery(Loader.java:674)
	org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	org.hibernate.loader.Loader.doList(Loader.java:2213)
	org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
	org.hibernate.loader.Loader.list(Loader.java:2099)
	org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
	org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
	org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
	org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
	org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
	org.rhq.enterprise.server.resource.ResourceManagerBean.disambiguate(ResourceManagerBean.java:2176)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
	org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
	org.rhq.enterprise.server.common.TransactionInterruptInterceptor.addCheckedActionToTransactionManager(TransactionInterruptInterceptor.java:77)
	sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
	org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:153)
	sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
	org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
	org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
	org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
	org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
	org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
	$Proxy316.disambiguate(Unknown Source)
	org.rhq.enterprise.gui.navigation.resource.ResourceSelectUIBean.autocomplete(ResourceSelectUIBean.java:116)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:616)
	org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
	org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
	org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
	org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
	org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
	org.richfaces.component.UISuggestionBox.setupValue(UISuggestionBox.java:492)
	org.richfaces.component.UISuggestionBox.broadcast(UISuggestionBox.java:424)
	javax.faces.component.UIData.broadcast(UIData.java:959)
	org.richfaces.component.UISuggestionBox.broadcast(UISuggestionBox.java:421)
	org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
	org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:343)
	org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:216)
	org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:169)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
	org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)
	org.rhq.enterprise.gui.legacy.WebUserTrackingFilter.doFilter(WebUserTrackingFilter.java:47)
	org.rhq.enterprise.gui.legacy.AuthenticationFilter.doFilter(AuthenticationFilter.java:137)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
	org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
	org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
	org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
	org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
	org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
	org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:124)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Comment 5 Adam Young 2010-02-25 22:39:23 UTC
The exception is triggered by 

ResourceManagerBean.disambiguate line 2165:

the calling line is:
  Object[] rs = (Object[]) disambiguateQuery.getSingleResult();

And it is

trying to execute this sql:


SELECT COUNT(r.ID) AS target_cnt, COUNT(DISTINCT(t.name)) AS bare_type_cnt,COUNT(DISTINCT(t.name || '~!@#)))' || t.plugin)) AS full_type_cnt,COUNT(DISTINCT(r.name)) AS l1_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END))) AS l2_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END) ||      '~!@#)))' || (CASE WHEN p2.name IS NULL THEN 'null' ELSE p2.name END))) AS l3_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END) ||      '~!@#)))' || (CASE WHEN p2.name IS NULL THEN 'null' ELSE p2.name END) ||      '~!@#)))' || (CASE WHEN p3.name IS NULL THEN 'null' ELSE p3.name END))) AS l4_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END) ||      '~!@#)))' || (CASE WHEN p2.name IS NULL THEN 'null' ELSE p2.name END) ||      '~!@#)))' || (CASE WHEN p3.name IS NULL THEN 'null' ELSE p3.name END) ||      '~!@#)))' || (CASE WHEN p4.name IS NULL THEN 'null' ELSE p4.name END))) AS l5_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END) ||      '~!@#)))' || (CASE WHEN p2.name IS NULL THEN 'null' ELSE p2.name END) ||      '~!@#)))' || (CASE WHEN p3.name IS NULL THEN 'null' ELSE p3.name END) ||      '~!@#)))' || (CASE WHEN p4.name IS NULL THEN 'null' ELSE p4.name END) ||      '~!@#)))' || (CASE WHEN p5.name IS NULL THEN 'null' ELSE p5.name END))) AS l6_cnt,COUNT(DISTINCT(r.name || '~!@#)))' || (CASE WHEN p1.name IS NULL THEN 'null' ELSE p1.name END)||      '~!@#)))' || (CASE WHEN p2.name IS NULL THEN 'null' ELSE p2.name END) ||      '~!@#)))' || (CASE WHEN p3.name IS NULL THEN 'null' ELSE p3.name END) ||      '~!@#)))' || (CASE WHEN p4.name IS NULL THEN 'null' ELSE p4.name END) ||      '~!@#)))' || (CASE WHEN p5.name IS NULL THEN 'null' ELSE p5.name END) ||      '~!@#)))' || (CASE WHEN p6.name IS NULL THEN 'null' ELSE p6.name END))) AS l7_cnt FROM RHQ_RESOURCE AS r JOIN RHQ_RESOURCE_TYPE AS t ON r.RESOURCE_TYPE_ID = t.ID LEFT OUTER JOIN RHQ_RESOURCE AS p1 ON r.PARENT_RESOURCE_ID = p1.ID LEFT OUTER JOIN RHQ_RESOURCE AS p2 ON p1.PARENT_RESOURCE_ID = p2.ID LEFT OUTER JOIN RHQ_RESOURCE AS p3 ON p2.PARENT_RESOURCE_ID = p3.ID LEFT OUTER JOIN RHQ_RESOURCE AS p4 ON p3.PARENT_RESOURCE_ID = p4.ID LEFT OUTER JOIN RHQ_RESOURCE AS p5 ON p4.PARENT_RESOURCE_ID = p5.ID LEFT OUTER JOIN RHQ_RESOURCE AS p6 ON p5.PARENT_RESOURCE_ID = p6.ID WHERE r.ID IN ()


I think the problem is the final line:  IN () is probably improper here.  However, I don't think that disambuiguate should be called at all if there are no results returned.

Comment 6 Adam Young 2010-02-25 22:55:54 UTC
I think I have a fix to 

modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java

@@ -113,24 +114,27 @@ public class ResourceSelectUIBean {
         result = resourceManager.findResourceComposites(EnterpriseFacesContextUtility.getSubject(), null, null, null,
             null, pref, true, pc);
 
+        if (result.size() == 0) {
+            return new ArrayList<DisambiguationReportWrapper>();
+        }
+
         return wrap(resourceManager.disambiguate(result, false, RESOURCE_ID_EXTRACTOR));
     }
-    
+

Comment 7 Lukas Krejci 2010-02-26 11:14:42 UTC
The above isn't the cause of this bug.

Adam rediscovered a bug that should have been fixed in master a while ago (how recent is your build?) but it actually is a completely different problem to what John reported.

I think the issue here is that the URL the search results point to is incorrect.

Comment 8 Lukas Krejci 2010-02-26 11:56:06 UTC
Fixed by commit b2f7c0e in master.

Comment 9 Adam Young 2010-02-26 16:36:35 UTC
Saw the erreor in raw config.  We merged at the end of last sprint.

Comment 10 Corey Welton 2010-03-19 14:26:35 UTC
QA Verified.  No longer get stack traces when doing a search for groups; intead, search result can be clicked through.

Comment 11 Corey Welton 2010-08-12 16:57:48 UTC
Mass-closure of verified bugs against JON.


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