Issue with ValueChangeListener and calling SLSB in Seam
rizviatt Oct 28, 2005 1:21 PMI am very new to Jboss seam based app development. Still working on prototyopes.
I have a JSF page with combo box which i am populating with list of users(For which i have entity called user).I am displaying realname in the combobox and values are the username.In the same page i have textbox fields for displaying fields of user like realaname , password etc.
Now what i would like to do is when i select a particular user from the combobox i want to populate the fields of realname and password for the corresponding selected user.
WHat I did was
I wrote a SLSB with a method "toggleUser(ValueChangeEvent event)" in which i do Database query to get the details for the selected user.
My jsp code looks like this
"
<h:selectOneMenu
valueChangeListener="#{useraction.toggleUser}"
onchange="this.form.submit();" immediate="true" value="# {user.username}">
<f:selectItems value="#{useraction.userList}"/>
</h:selectOneMenu>
"
where useraction is SLSB. and user is entity bean.
The page when initially loaded works fine. It gets loaded with users.But problem happens when i select a user.
I get the folowing exception
java.lang.reflect.UndeclaredThrowableException
at $Proxy136.toggleUser(Unknown Source)
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:585)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:138)
at javax.faces.component.UIInput.broadcast(UIInput.java:200)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:132)
at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:177)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:87)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.NotSerializableException: javax.faces.event.PhaseId
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.rmi.MarshalledObject.(MarshalledObject.java:92)
at org.jboss.aop.joinpoint.MethodInvocation.writeExternal(MethodInvocation.java:271)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1304)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1282)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.rmi.MarshalledObject.(MarshalledObject.java:92)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:35)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
... 31 more
Is it because ValueChangeEvent is not serialized ???.
Any help would be appreciated.