Bug 594417 - StringIndexOOBE in ListChildResources - due to Pluralizer
StringIndexOOBE in ListChildResources - due to Pluralizer
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
3.0.0
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: Heiko W. Rupp
Corey Welton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-20 11:51 EDT by Heiko W. Rupp
Modified: 2010-08-12 12:57 EDT (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2010-05-20 11:51:34 EDT
Deploy the nagios plugin,
Go to the platform , do a "manual add". After the page with the properties, click ok and a page
with a stack trace shows up

StringIndexOutOfBoundsException
String index out of range: -1

Stacktrace is below

Debugging shows that it is the child list on the inventory tab of the server that makes this bail out.
Further debugging leads to org.jvnet.inflector.rule.SuffixInflectionRule#apply()
where the Pluralizer wants to Pluralize "SSH" and fails

		int i = word.lastIndexOf(singularSuffix.substring(1));
		//TODO: check i
		// TODO: make case insensitive
		return word.substring(0, i) + pluralSuffix.substring(1);

word is 'SSH'
singluarSuffix is '-h'
so i turns out to be -1 and substring(0,-1) bails out.







17:23:18,537 ERROR [GenericErrorUIBean] Error processing user request
javax.faces.FacesException: javax.el.ELException: /rhq/resource/inventory/view.xhtml @127,85 value="#{ListChildResourcesUIBean.utilizedChildServiceTypes}": Error reading 'utilizedChildServiceTypes' on type org.rhq.enterprise.gui.inventory.resource.ListChildResourcesUIBean
        at javax.faces.component.UISelectItems.getValue(UISelectItems.java:144)
        at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:283)
        at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:783)
        at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:244)
        at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:106)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
        at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
        at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
        at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
        at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200)
        at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195)
        at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
        at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
        at org.rhq.enterprise.gui.common.framework.FaceletRedirectionViewHandler.renderView(FaceletRedirectionViewHandler.java:64)
        at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
        at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.rhq.enterprise.gui.legacy.WebUserTrackingFilter.doFilter(WebUserTrackingFilter.java:50)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.rhq.enterprise.gui.legacy.AuthenticationFilter.doFilter(AuthenticationFilter.java:129)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.rhq.enterprise.gui.common.upload.MultipartFilter.doFilter(MultipartFilter.java:63)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
        at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
        at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
        at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
        at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        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: javax.el.ELException: /rhq/resource/inventory/view.xhtml @127,85 value="#{ListChildResourcesUIBean.utilizedChildServiceTypes}": Error reading 'utilizedChildServiceTypes' on type org.rhq.enterprise.gui.inventory.resource.ListChildResourcesUIBean
        at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
        at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141)
        ... 81 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1937)
        at org.jvnet.inflector.rule.SuffixInflectionRule.apply(SuffixInflectionRule.java:57)
        at org.jvnet.inflector.RuleBasedPluralizer.pluralizeInternal(RuleBasedPluralizer.java:169)
        at org.jvnet.inflector.RuleBasedPluralizer.pluralize(RuleBasedPluralizer.java:147)
        at org.jvnet.inflector.RuleBasedPluralizer.pluralize(RuleBasedPluralizer.java:121)
        at org.rhq.enterprise.gui.inventory.resource.ListChildResourcesUIBean.convertToSelectItems(ListChildResourcesUIBean.java:300)
        at org.rhq.enterprise.gui.inventory.resource.ListChildResourcesUIBean.getUtilizedChildServiceTypes(ListChildResourcesUIBean.java:138)
        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 javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
        at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
        at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
        at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
        at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
        at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
        at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
        ... 82 more
17:23:23,556 INFO  [CacheConsistencyManagerBean] localhost took [45]ms to reload cache for 1 agents
Comment 1 Heiko W. Rupp 2010-05-20 11:59:43 EDT
Others were/are having the same issue - see e.g.
http://forum.springsource.org/showthread.php?p=265672

So Pluralizer for all words ending in upper case will produce this exception

jvnet 0.7.0 is apparently the latest version.
Comment 2 Heiko W. Rupp 2010-05-20 12:10:13 EDT
Fixed in 66f5dff

How to repeat:

Take a resource with resourceType into inventory who's type name is all caps - like 'SSH' from the NagiosPlugin.
Go to the parent resource and click on the inventory tab to see the list of children (that should include the resource from above).
Comment 3 Corey Welton 2010-06-02 15:40:21 EDT
QA Verified.  I don't appear to be getting OOBEs with resources whose names are all caps.
Comment 4 Corey Welton 2010-08-12 12:57:41 EDT
Mass-closure of verified bugs against JON.

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