Bug 144409

Summary: NumberFormatException thrown if no web.allow_pxt_personalities is defined.
Product: [Retired] Red Hat Network Reporter: Jesus M. Rodriguez <jesusr>
Component: RHN/R&DAssignee: Ryan Bloom <rbb>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: RHN Devel   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-20 19:26:28 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: 125080    

Description Jesus M. Rodriguez 2005-01-06 20:02:06 UTC
An exception is thrown if web.allow_pxt_personalities is not
present or of the wrong format in the configuration files.
Config.getInt() should throw a NumberFormatException.
And the call of that should handle such an error.

Files affected:
RhnHelper.java: getSessionCookieName, line 408
Config.java: getInt, line 165

Exception:
java.lang.NumberFormatException: null
	java.lang.Integer.parseInt(Integer.java(Compiled Code))
	java.lang.Integer.parseInt(Integer.java(Compiled Code))
	com.redhat.rhn.common.conf.Config.getInt(Config.java:165)
	com.redhat.rhn.frontend.struts.RhnHelper.getSessionCookieName(RhnHelper.java:408)
	com.redhat.rhn.frontend.struts.RhnHelper.findUserSession(RhnHelper.java:134)
	com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:65)
	com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:142)
	com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58)
	com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:73)

Comment 1 Ryan Bloom 2005-01-20 19:26:08 UTC
Asking for a non-existant config variable shouldn't throw an exception
at all.  It should return a sane default, in this case 0.  The code
now does this.