Erro ao chamar metodo

1 resposta
M

bom dia... pessoal to com um problema e nao consigo visualizar o que é.... o erro que da é esse.

14/12/2011 08:36:19 com.sun.faces.application.ActionListenerImpl processAction
GRAVE: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)
	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:787)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
	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:508)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	... 24 more
14/12/2011 08:36:19 com.sun.faces.lifecycle.InvokeApplicationPhase execute
AVISO: #{caixaBean.relatorio}: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
javax.faces.FacesException: #{caixaBean.relatorio}: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:110)
	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
	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:508)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	... 23 more
Caused by: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	... 24 more
14/12/2011 08:36:19 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/Projeto_Faculdade] threw exception [javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()] with root cause
javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}": Method not found: [email removido]()
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	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:787)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
	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:508)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

meu Bean

package br.com.projeto.controller;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import br.com.projeto.beans.Caixa;
import br.com.projeto.beans.OrdemDeServico;
import br.com.projeto.dao.HibernateDao;

@ManagedBean
@SessionScoped
public class CaixaBean {

	private List<OrdemDeServico> ordensDeServico = new ArrayList<OrdemDeServico>();
	private OrdemDeServico ordemDeServico = new OrdemDeServico();
	private Caixa caixa = new Caixa();

	public List<OrdemDeServico> getRelatorio() {
		HibernateDao<OrdemDeServico> hibernateDao = new HibernateDao<OrdemDeServico>(OrdemDeServico.class);
		ordensDeServico = hibernateDao.getListData(caixa.getDataInicial(), caixa.getDataFinal());

		for (int i = 0; i < ordensDeServico.size(); ++i) {
			ordemDeServico = ordensDeServico.get(i);
			caixa.setValorDiario(caixa.getValorDiario()	+ ordemDeServico.getValorTotal());
		}
		
		System.out.println("Resultadoooooooooooooooooooooooooooooo  ");
		
		return null;
	}
	
	
	
	
	
	

	public List<OrdemDeServico> getOrdensDeServico() {
		return ordensDeServico;
	}

	public void setOrdensDeServico(List<OrdemDeServico> ordensDeServico) {
		this.ordensDeServico = ordensDeServico;
	}

	public Caixa getCaixa() {
		return caixa;
	}

	public void setCaixa(Caixa caixa) {
		this.caixa = caixa;
	}

	public OrdemDeServico getOrdemDeServico() {
		return ordemDeServico;
	}

	public void setOrdemDeServico(OrdemDeServico ordemDeServico) {
		this.ordemDeServico = ordemDeServico;
	}

}

meu jsf

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<title>Relatório De Caixa</title>
</h:head>
<h:body>
	<h:form id="form1">
		<div align="center">
			<p:panel header="Solicitação De Ordem De Serviço"
				style="width:1050px">
				<ui:include src="/Menu.xhtml" />
				<div align="left">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<h:outputLabel value="Data Inicial" />
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<h:outputLabel value="Data Final" />
				</div>


				<p:calendar value="#{caixaBean.caixa.dataInicial}"
					pattern="dd/MM/yyyy" required="true" />

							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    
							                    				
					<p:calendar value="#{caixaBean.caixa.dataFinal}"
					pattern="dd/MM/yyyy" required="true" />
					
					&nbsp;&nbsp;
					
					<h:commandButton action="#{caixaBean.relatorio}" />

			</p:panel>
		</div>
	</h:form>
</h:body>
</html>

alguem ajuda...

vlw

1 Resposta

Diego_Adriano

Cara, não é por nada … mas onde esta o seu método ? caixaBean.relatorio .
Ele não esta encontrando o método, por isso do erro:

GRAVE: javax.el.MethodNotFoundException: /RelatorioDeCaixa.xhtml @36,57 action="#{caixaBean.relatorio}"

Parece que vc esta tentando amarrar o botão ao getRelatorios mas na verdade vc deve amarrar ele a um dataTable

Criado 14 de dezembro de 2011
Ultima resposta 14 de dez. de 2011
Respostas 1
Participantes 2