This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Dropdown valueChangeEvent giving problems

 
Sree Jag
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I'm trying to fire a valueChangeEvent on a drop down. But i keep getting the following exception:

00000030 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown : javax.servlet.ServletException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.fbfs.cp.security.TestFilter.doFilter(TestFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
---- Begin backtrace for Nested Throwables
java.util.NoSuchElementException
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:96)
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:122)
at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:140)
at javax.faces.component.UISelectOne.validate(UISelectOne.java:113)
at javax.faces.component.UIInput.executeValidate(UIInput.java:796)
at javax.faces.component.UIInput.processDecodes(UIInput.java:383)
at javax.faces.component.UIForm.processDecodes(UIForm.java:139)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:341)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:81)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:201)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.fbfs.cp.security.TestFilter.doFilter(TestFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

[10/23/06 10:59:04:025 EDT] 00000030 ServletWrappe E SRVE0014E: Uncaught service() exception root cause Faces Servlet: java.util.NoSuchElementException
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:96)
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:122)
at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:140)
at javax.faces.component.UISelectOne.validate(UISelectOne.java:113)
at javax.faces.component.UIInput.executeValidate(UIInput.java:796)
at javax.faces.component.UIInput.processDecodes(UIInput.java:383)
at javax.faces.component.UIForm.processDecodes(UIForm.java:139)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:341)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:81)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:201)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.fbfs.cp.security.TestFilter.doFilter(TestFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

[10/23/06 10:59:04:041 EDT] 00000030 WebApp E SRVE0026E: [Servlet Error]-[Faces Servlet]: java.util.NoSuchElementException
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:96)
at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:122)
at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:140)
at javax.faces.component.UISelectOne.validate(UISelectOne.java:113)
at javax.faces.component.UIInput.executeValidate(UIInput.java:796)
at javax.faces.component.UIInput.processDecodes(UIInput.java:383)
at javax.faces.component.UIForm.processDecodes(UIForm.java:139)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:908)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:341)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:81)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:201)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.fbfs.cp.security.TestFilter.doFilter(TestFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

Here's my JSP Code:

<h:selectOneMenu styleClass="selectOneMenu" id="menu1"
value="#{lookupBO.currentLookup}"
onchange="submit();"
valueChangeListener="#{lookupBO.retrieveLookup}"
>
<f:selectItems value="#{lookupBO.listOfLookups}" />
</h:selectOneMenu></TD>



and the Backing Bean code that creates this list and handles the valueChangeEvent is:

SelectItem[] listOfLookups = new SelectItem[]{
new SelectItem("", ""),
new SelectItem("XXXX", "YYYYY"),
new SelectItem("AAAA", "BBBB")
};

public void retrieveLookup(ValueChangeEvent ve){

String value = "";

value = (String)ve.getNewValue();

System.out.println("********* The new Value is = "+value);
FacesContext fc = FacesContext.getCurrentInstance();
fc.renderResponse();
}



The request is not coming to this value change function at all.

Somone, please throw some light on this.

Thank you,
Seshu
 
Sree Jag
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved this puzzle. The problem was with another dropdown. I created an empty ArrayList to populate that dropdown. That was causing this exception. So, i added a new SelectItem object (new SelectItem("","")).

This fixed the problem
Hope this helps some one else.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic