Bug 596667 - ArrayIndexOutOfBoundsException in server log when there is a search criteria and user enters an opening parenthesis at the beginning of search bar.
Summary: ArrayIndexOutOfBoundsException in server log when there is a search criteria ...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
(Show other bugs)
Version: 3.0.0
Hardware: All Linux
high
medium vote
Target Milestone: ---
: ---
Assignee: Joseph Marques
QA Contact: Corey Welton
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: rhq_triage jon-sprint10-bugs
TreeView+ depends on / blocked
 
Reported: 2010-05-27 09:32 UTC by Sunil Kondkar
Modified: 2010-08-12 16:47 UTC (History)
0 users

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 16:47:11 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot for message in search bar (118.88 KB, image/png)
2010-05-27 09:32 UTC, Sunil Kondkar
no flags Details

Description Sunil Kondkar 2010-05-27 09:32:52 UTC
Created attachment 417163 [details]
Screenshot for message in search bar

Description of problem:
When user enters a search criteria in search bar for ex: 

type=="JBossAS Server" | type=="Apache HTTP Server"

User navigates to the beginning of search bar and enters an opening parenthesis. it displays a message is search bar as 'The call failed on the server, see server log for details'.

Please refer the screenshot for above message.

The server log displays ArrayIndexOutOfBoundsException.

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


How reproducible:
always

Steps to Reproduce:

1.Login to rhq
2.click on 'Resources->All Resources in menu
3.Enter search criteria (Ex: type=="JBossAS Server" | type=="Apache HTTP Server")
4.Navigate to the beginning of searchbar and enter an opening parenthesis.
5.Observe the server log.
  
Actual results:
The server log displays ArrayIndexOutOfBoundsException.

Additional info:

Below are the details in server log:

2010-05-27 14:47:26,192 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 java.util.List org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTService.getSuggestions(org.rhq.core.domain.search.SearchSubsystem,java.lang.String,int)' threw an unexpected exception: java.lang.ArrayIndexOutOfBoundsException
        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:619)
Caused by: java.lang.ArrayIndexOutOfBoundsException
2010-05-27 14:47:26,224 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 java.util.List org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTService.getSuggestions(org.rhq.core.domain.search.SearchSubsystem,java.lang.String,int)' threw an unexpected exception: java.lang.ArrayIndexOutOfBoundsException
        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:619)
Caused by: java.lang.ArrayIndexOutOfBoundsException

Comment 1 Sunil Kondkar 2010-05-27 09:52:20 UTC
Above exception is observed on Jon build#170 (Revision: 10621)

Comment 2 Sunil Kondkar 2010-05-31 11:11:33 UTC
Also observed that if user enters a single inverted comma (') in search bar, the server log displays IllegalArgumentException.

Below is the server log:

2010-05-31 16:30:08,480 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 java.util.List org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTService.getSuggestions(org.rhq.core.domain.search.SearchSubsystem,java.lang.String,int)' threw an unexpected exception: java.lang.IllegalArgumentException: org.hibernate.QueryException: unexpected char: '%' [SELECT DISTINCT res.name   FROM org.rhq.core.domain.resource.Resource res  WHERE LOWER(res.name) LIKE '%'%' ORDER BY res.name ]
        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:619)
Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: unexpected char: '%' [SELECT DISTINCT res.name   FROM org.rhq.core.domain.resource.Resource res  WHERE LOWER(res.name) LIKE '%'%' ORDER BY res.name ]
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:616)
        at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
        at org.rhq.enterprise.server.search.assist.AbstractSearchAssistant.execute(AbstractSearchAssistant.java:64)
        at org.rhq.enterprise.server.search.assist.ResourceSearchAssistant.getValues(ResourceSearchAssistant.java:95)
        at org.rhq.enterprise.server.search.execution.SearchAssistManager.getSimpleSuggestions(SearchAssistManager.java:374)
        at org.rhq.enterprise.server.search.execution.SearchAssistManager.getSuggestions(SearchAssistManager.java:331)
        at org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl.getSuggestions(SearchGWTServiceImpl.java:43)
        at sun.reflect.GeneratedMethodAccessor1689.invoke(Unknown Source)
        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: org.hibernate.QueryException: unexpected char: '%' [SELECT DISTINCT res.name   FROM org.rhq.core.domain.resource.Resource res  WHERE LOWER(res.name) LIKE '%'%' ORDER BY res.name ]
        at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:204)
        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)
        ... 36 more

Comment 3 Joseph Marques 2010-06-01 17:32:25 UTC
commit fe6d11855e7713737e6f343eca35ca87d24b23d0
Author: Joseph Marques <joseph@redhat.com>
Date:   Tue Jun 1 13:28:46 2010 -0400

BZ-596667: fix ArrayIndexOutOfBoundsException when single quote is typed into SearchBar
    
* improve handling of search expressions surrounded by single- and/or double-quotes
* quoted, incomplete search expressions no longer provide Advanced suggestions
* do NOT highlight surrounding quotes as part of the autocompletion match algorithm

Comment 4 Sunil Kondkar 2010-06-02 09:52:37 UTC
Verified on Jon build#191 (Revision: 10627)

No exception is observed when an opening parenthesis is entered at the beginning of search bar when there is a search criteria.
There is no exception when a single quote is entered into searchbar.

Also observed that when the search expression is quoted, the incomplete expressions does not provide suggestions.
Quotes are not highlighted for auto completion match.

Comment 5 Corey Welton 2010-08-12 16:47:11 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.