p:ajax throwing method not found exception with p:selectOneRadio - jsf

I am trying to Ajax event with p:selectOneRadio> and I'm getting
WARNING: Method not found: com.ccc.managedController.TweetDistributionManagedBean#78159a62.renderUploadPanel(javax.faces.event.AjaxBehaviorEvent)
javax.el.MethodNotFoundException: Method not found: com.ccc.managedController.TweetDistributionManagedBean#78159a62.renderUploadPanel(javax.faces.event.AjaxBehaviorEvent)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Here are more code
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="selectone" value="Upload :" />
<p:selectOneRadio id="selectone"
value="#{tweetDistributionManagedBean.tweetType}">
<f:selectItem itemLabel="Group Tweets" itemValue="GT" />
<f:selectItem itemLabel="Event Tweets" itemValue="ET" />
<f:selectItem itemLabel="Suprachar Tweets" itemValue="ST" />
<p:ajax event="click"
listener="#{tweetDistributionManagedBean.renderUploadPanel}"
update="gtid" process="#form" global="false" />
</p:selectOneRadio>
</h:panelGrid>
and Java bean method
public void renderUploadPanel(final SelectEvent event) {
String selecteValues = (String) event.getObject();
visibleGTFlag = true;
}

Moist likely the 'SelectEvent' is not an event that extends AjaxBehaviourEvent . This can happen if you import the wrong class type. Try this
public void renderUploadPanel(AjaxBehaviorEvent event) {
System.out.println(tweetType);
visibleGTFlag = true;
}

You can try to use the event "ValueChangeEvent", look my example:
public void renderUploadPanel(ValueChangeEvent event) {
String selecteValues = event.getNewValue().toString();
visibleGTFlag = true;
}

Related

javax.el.MethodNotFoundException: Method not found: tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)

I have problems with the selection checkbox in datatable, I add a ajax with "rowSelectCheckbox" event and to select a checkbox suge the following error:
WARNING: Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
javax.el.MethodNotFoundException: Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
at
org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271) at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at
org.primefaces.event.SelectEvent.processListener(SelectEvent.java:40)
at
javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086) at
javax.faces.component.UIData.broadcast(UIData.java:1108) at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
jul 06, 2015 5:05:21 PM com.sun.faces.context.AjaxExceptionHandlerImpl
handlePartialResponseError SEVERE: javax.el.MethodNotFoundException:
Method not found:
tes.sales.bean.DocumentosBean#1821df11.onTestEvent(org.primefaces.event.SelectEvent)
at
org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:245)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271) at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at
org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at
org.primefaces.event.SelectEvent.processListener(SelectEvent.java:40)
at
javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086) at
javax.faces.component.UIData.broadcast(UIData.java:1108) at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
xhtml
<h:form>
<p:dataTable id="myTable" var="mydoc" value="#{DocumentosBean.documentos}" rows="20" paginator="true" sortOrder="descending"
selection="#{DocumentosBean.selectedDocs}" filteredValue="#{DocumentosBean.myFilter}"
sortBy="#{mydoc.id}" rowKey="#{mydoc.id}" rowIndexVar="indexRow">
<p:ajax event="rowSelectCheckbox" listener="#{DocumentosBean.onTestEvent}" />
<p:ajax event="rowUnselectCheckbox" process="#this"/>
<p:ajax event="toggleSelect" process="#this"/>
<p:column selectionMode="multiple" style="min-width:20px;text-align:center;"></p:column>
<p:column headerText="Id">
<h:outputText value="#{mydoc.id}" />
</p:column>
<p:column headerText="Vendedor">
<h:outputText value="#{mydoc.vendedor}" />
</p:column>
<p:column headerText="Moneda">
<h:outputText value="#{mydoc.moneda}" />
</p:column>
<p:column headerText="Operación">
<h:outputText value="#{mydoc.operacion}" />
</p:column>
<p:column headerText="Fecha Creación">
<h:outputText value="#{mydoc.fechaCreacion}" />
</p:column>
<p:column headerText="Estado">
<h:outputText value="#{mydoc.estado}" />
</p:column>
</p:dataTable>
</h:form>
Bean
#ManagedBean(name="DocumentosBean")
#SessionScoped
public class DocumentosBean implements Serializable {
private static final long serialVersionUID = 1L;
private List<ListaDocumentos> documentos;
private ListaDocumentos selectedDoc;
private ListaDocumentos[] selectedDocs;
private List<ListaDocumentos> myFilter;
public DocumentosBean() {
System.out.println("SelectEvent");
documentos = new ArrayList<ListaDocumentos>();
fillData(documentos);
/*myFilter = new ArrayList<ListaDocumentos>();
fillData(myFilter);*/
}
public void onTestEvent(SelectEvent e){
System.out.println(".......");
System.out.println(e.getObject().toString());
}
}

Primefaces dataTable rowSelectCheckbox,rowUnSelectbox and toggleSelect events

I have datatable with checkbox selection option and I want to track check,uncheck and toggle select events. My code is :
<p:dataTable id="faDetail" value="#{assetSWOMB.faDetailList}"
lazy="true" rowIndexVar="rowsn" var="fad" rowKey="fad.id"
selection="#{assetSWOMB.selectedList}" scrollable="true"
scrollHeight="115">
<p:ajax event="rowSelectCheckbox" ajax="true"
immediate="true" listener="#{assetSWOMB.onCheck()}"
update=":mainForm:countUser" process="#this" />
<p:ajax event="rowUnselectCheckbox" ajax="true"
immediate="true" listener="#{assetSWOMB.onCheck()}"
update=":mainForm:countUser" process="#this" />
<f:facet name="header">
Asset Detail List
</f:facet>
<p:column style="width:16px;text-align:center"
selectionMode="multiple" />
<p:column headerText="#">
<h:outputText value="#{rowsn+1}" />
</p:column>
<p:column headerText="Given Name">
<h:outputText value="#{fad.assetGivenName}" />
</p:column>
<p:column headerText="Brand Name">
<h:outputText value="#{fad.brandDescription}" />
</p:column>
</p:dataTable>
Function in Managed Bean is :
public void onCheck(){
userCount = selectedList.size();
}
While selecting a checkbox (check or uncheck), it always displays following error :
com.sun.faces.context.PartialViewContextImpl processPartial
INFO: javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled or you need to define rowKey attribute
javax.faces.FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled or you need to define rowKey attribute
at org.primefaces.component.datatable.DataTable.getRowData(DataTable.java:950)
at org.primefaces.component.datatable.feature.SelectionFeature.decodeMultipleSelection(SelectionFeature.java:71)
at org.primefaces.component.datatable.feature.SelectionFeature.decode(SelectionFeature.java:40)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:57)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787)
at org.primefaces.component.api.UIData.processDecodes(UIData.java:228)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:506)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at org.primefaces.component.api.UIData.visitTree(UIData.java:639)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:376)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:252)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:931)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.magnus.filter.LoginCheckFilter.doFilter(LoginCheckFilter.java:129)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
But I have defined rowKey.
How to make it work ??
Try with this rowKey="#{fad.id}"

tabview inside another tabview

i 'am trying to put a tabview inside a another tabview but i get error in the ajax event from the tabview inside here is the error
javax.el.MethodNotFoundException: Method not found: com.controlleurs.SelectBean#75c0452.onTabChange1(javax.faces.event.AjaxBehaviorEvent)
at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:249)
at org.apache.el.parser.AstValue.invoke(AstValue.java:271)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processCustomListener(AjaxBehaviorListenerImpl.java:87)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:72)
at org.primefaces.component.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
at javax.faces.component.UIData.broadcast(UIData.java:1086)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIData.broadcast(UIData.java:1108)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
here is my xhmtl code
<h:form id="form">
<p:tabView id="my" >
<p:tab id="tabview" title="Ressources Humaines">
<p:tabView activeIndex="#{SelectBean.activeTab}" value="#{SelectBean.types}" var="item" >
<p:ajax event="tabChange" listener="#{SelectBean.onTabChange}" update=":form" />
<p:tab title="#{item}">
<p:tabView id="tab" activeIndex="#{SelectBean.other}" value="#{SelectBean.res}" var="rr">
<p:ajax event="tabChange" listener="#{SelectBean.onTabChange1}" />
<p:tab title="#{rr.nom_ressource}">
<h:panelGrid>
<h:graphicImage value="Ressources/images/emp.jpg" style="vertical-align:middle" />
<span style="font-size:15px; width:170px; display:inline-block;"> Nom : #{rr.nom_ressource} Type: #{rr.type_ressource} Specification: #{rr.experience} </span>
<h:commandButton image="Ressources/images/delete.jpg" actionListener="#{SelectBean.act}" update=":form" style="vertical-align:middle" >
Supprimer
</h:commandButton>
<h:commandButton image="Ressources/images/update.png" style="vertical-align:middle" >
Modifier
</h:commandButton>
</h:panelGrid>
</p:tab>
</p:tabView>
</p:tab>
</p:tabView>
</p:tab>
<p:tab title="Ressources Materielle">
</p:tab>
</p:tabView>
</h:form>
anyhelp please
In your bean he cant find the method..
The signature of the method should be public void onTabChange(TabChangeEvent event)
This is how your method signature looks like?
Why you have double <p:ajax event="tabChange"
Hope that help

JSF java.lang.IllegalArgumentException: can't parse argument number

can someone help me figure out the problem i'm new on JSF. whenever i load my page and submit my form i get this error :
here is my code :
#ManagedBean
#ApplicationScoped
public class CommandeController extends JSFActions {
final static Logger LOGGER = LoggerFactory.getLogger( CommandeController.class );
#ManagedProperty( value = "#{commandeBean}")
private CommandeBean commandeBean;
#ManagedProperty( value = "#{clientBean}")
private ClientBean clientBean;
#ManagedProperty( value = "#{etablissementBean}")
private EtablissementBean etablissementBean;
#ManagedProperty( value = "#{commandeFacade}")
private ICommandeFacade commandeFacade;
and my xhtml file look like
<h:outputText value="#{lbl.postRef}" />
<p:selectOneMenu value="#{commandeBean.idPoste}">
<f:selectItem itemLabel="Choisissez le poste" itemValue="-1"/>
<f:selectItems value="#{jFActions.postes.entrySet()}" var="post"
itemValue="#{post.key}" itemLabel="#{post.value}"/>
</p:selectOneMenu>
<h:outputText value="#{lbl.langUse}" />
<p:selectOneMenu value="#{commandeBean.langUtilise}">
<f:selectItem itemLabel="Choisissez la langue" itemValue="-1"/>
<f:selectItem itemValue="ar" itemLabel="Arabe"/>
<f:selectItem itemValue="en" itemLabel="Enlish"/>
<f:selectItem itemValue="fr" itemLabel="Frensh"/>
</p:selectOneMenu>
<h:outputText value="#{lbl.nbJ}" />
<p:inputText id="txtNbrJour" value="#{commandeBean.nbJour}" converterMessage="#{msg.nbrInvalid}" >
<f:convertNumber type="number" integerOnly="true" />
</p:inputText>
<h:outputText value="#{lbl.nbjMax}" />
<p:inputText id="txtNJAut" value="#{etablissementBean.nbJourAutorise}" readonly="true" />
ATTENTION: Erreur inattendue lors du traitement du bean géré «commandeController»
com.sun.faces.mgbean.ManagedBeanPreProcessingException: Erreur inattendue lors du traitement du bean géré «commandeController»
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:398)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.parser.AstValue.getTarget(AstValue.java:94)
at org.apache.el.parser.AstValue.invoke(AstValue.java:259)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.faces.mgbean.ManagedBeanPreProcessingException: Erreur inattendue lors du traitement de la propriété gérée «commandeBean»
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:117)
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
... 35 more
Caused by: java.lang.IllegalArgumentException: can't parse argument number commandeBean
at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
at java.text.MessageFormat.<init>(MessageFormat.java:350)
at java.text.MessageFormat.format(MessageFormat.java:811)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:398)
at com.sun.faces.mgbean.BeanBuilder$Expression.validateLifespan(BeanBuilder.java:574)
at com.sun.faces.mgbean.BeanBuilder$Expression.<init>(BeanBuilder.java:523)
at com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:363)
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107)
... 36 more
18 févr. 2014 10:48:37 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/sgrp-web] threw exception [Erreur inattendue lors du traitement du bean géré «commandeController»] with root cause
java.lang.IllegalArgumentException: can't parse argument number commandeBean
at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
at java.text.MessageFormat.<init>(MessageFormat.java:350)
at java.text.MessageFormat.format(MessageFormat.java:811)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:398)
at com.sun.faces.mgbean.BeanBuilder$Expression.validateLifespan(BeanBuilder.java:574)
at com.sun.faces.mgbean.BeanBuilder$Expression.<init>(BeanBuilder.java:523)
at com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:363)
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107)
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.parser.AstValue.getTarget(AstValue.java:94)
at org.apache.el.parser.AstValue.invoke(AstValue.java:259)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at
any help ??
You are using a NumberConverter to convert an object. Use a custom converter instead.
In my case it was happening because I was logging the JSON {"":{}} output and that why system generating this exception. JSON was treating like a string in LogDebug method.
Use vlogDebug("my log {0}",jsonObject). It will work as it is now in argument {0}.

java.lang.ClassCastException: cannot be cast to java.util.List

I have two classes that there is a relationship # OneToMany (Pay and Split) the code below:
#Entity
#Table(name="pagamento")
public class Pagamento implements Serializable { //Class Pay
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Column(name="idpagamento")
private int id;
...
#ManyToOne()
#JoinColumn(name="idconta")
private Divida coddivida;
and below class Split
#Entity
#Table(name="divida")
public class Divida implements Serializable{
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Column(name = "idconta")
private int id;
...
#OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER, mappedBy="coddivida", targetEntity = Pagamento.class)
private List<Pagamento> pagamento;
And I search through the data code below:
public List<Divida> getDividas(){
return getCleanListOfObjects(Divida.class,"from Divida divida");
}
And I'm trying to display in a datatable is as below:
<p:dataTable id="paneluser" value="#{dividaFaces.listofDivida}" var="divida" selection="#{dividaFaces.selectedDivida}"
rowKey="#{divida.id}" selectionMode="sigle" emptyMessage="Não existe Dívida" paginator="true" rows="10">
<f:facet name="header">
Panel de Dívidas Cadastradas
</f:facet>
<p:column headerText="Descricão">
#{divida.descricao}
</p:column>
<p:column id="pagar" headerText="Tela de Pagamento">
<p:commandButton value="Pagar">
<p:ajax oncomplete="pagetela.show()" update="telapgamento"/>
</p:commandButton>
</p:column>
<f:facet name="footer">
Financé v#{sistema.VERSION}
</f:facet>
</p:dataTable>
But it is giving the error below:
Hibernate:
/*
from
Divida divida */ select
divida0_.idconta as idconta0_,
divida0_.datadeinicio as datadein2_0_,
divida0_.descricaodespesa as descrica3_0_,
divida0_.empresa as empresa0_,
divida0_.exercicio as exercicio0_,
divida0_.observacao as observacao0_,
divida0_.operacaobancaria as operacao7_0_,
divida0_.parcela as parcela0_,
divida0_.tipolancamento as tipolanc9_0_,
divida0_.vencimento as vencimento0_
from
divida divida0_
Lista de Dividas: []
Hibernate:
/*
from
Divida divida */ select
divida0_.idconta as idconta0_,
divida0_.datadeinicio as datadein2_0_,
divida0_.descricaodespesa as descrica3_0_,
divida0_.empresa as empresa0_,
divida0_.exercicio as exercicio0_,
divida0_.observacao as observacao0_,
divida0_.operacaobancaria as operacao7_0_,
divida0_.parcela as parcela0_,
divida0_.tipolancamento as tipolanc9_0_,
divida0_.vencimento as vencimento0_
from
divida divida0_
Mar 26, 2013 8:34:31 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
SEVERE: Error Rendering View[/menu/principal.xhtml]
java.lang.ClassCastException: br.com.finance.model.Divida cannot be cast to java.util.List
at org.primefaces.component.datatable.DataTable.findSelectedRowKeys(DataTable.java:977)
at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:624)
at org.primefaces.component.datatable.DataTableRenderer.encodeRegularTable(DataTableRenderer.java:234)
at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:196)
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:82)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:881)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:851)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Can anyone help me?
You are using selectionMode="sigle". Please notice the missing 'n' in single. The exception you are encoutering here has nothing to do with Hibernate.

Resources