This discussion is archived
2 Replies Latest reply: Oct 4, 2012 10:18 PM by 798844 RSS

Getting NumberFormatException when creating component programatically

798844 Newbie
Currently Being Moderated
eg: i have a event object which is added in flow with flowScope, event class has "cars" list which contains list of "car" object

program for creating dyamic component
for(Car car: cars){

UIComponent fieldComponent = new HtmlInputText();
fieldComponent.setValueExpression("value", createValueExpression("#{event.cars['" + car + "'].color}", String.class));
}
etc....
when i run this i am getting below exception

org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'dynamicDetails' of flow 'workflow/event'
     at org.springframework.webflow.engine.impl.FlowExecutionImpl.wrap(FlowExecutionImpl.java:569)
     at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:263)
     at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
     at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:788)
     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
     at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
     at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
     at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
     at de.unicreditgroup.esa.web.login.spring.EsaAuthenticationFilter.doFilter(EsaAuthenticationFilter.java:236)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at de.unicreditgroup.esa.web.login.TimeoutFilter.doFilter(TimeoutFilter.java:72)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.FacesException: For input string: "Car@d7f563[min=-2147483648, color=blue"]
     at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:136)     
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
     at org.springframework.faces.webflow.FlowLifecycle.render(FlowLifecycle.java:80)
     at org.springframework.faces.webflow.JsfView.render(JsfView.java:90)
     at org.springframework.webflow.engine.ViewState.render(ViewState.java:314)
     at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:265)
     at org.springframework.webflow.engine.ViewState.resume(ViewState.java:243)
     at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
     at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
     ... 43 more

     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
     at java.lang.Integer.parseInt(Integer.java:449)
     at java.lang.Integer.valueOf(Integer.java:554)
     at com.sun.el.lang.ELSupport.coerceToNumber(ELSupport.java:303)
     at com.sun.el.lang.ELSupport.coerceToNumber(ELSupport.java:279)
     at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:373)
     at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:55)
     at com.sun.faces.el.PropertyResolverChainWrapper.getValue(PropertyResolverChainWrapper.java:77)
     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
     at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
     at de.unicreditgroup.esa.web.jsf.core.bean.resolver.PostProcessingELResolver.getValue(PostProcessingELResolver.java:76)
     at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
     at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
     at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
     at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
     at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
     at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
     at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:295)
     at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
     at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
     at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
     at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:57)
     at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:45)
     at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:185)
     at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:108)
     at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:55)
     at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
     at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:61)
     at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:45)
     at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:46)
     at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
     at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:295)
     at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
     at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
     at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
     at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
     at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)

how do i go about it?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points