I'm developing a project and I'm having a pretty annoying problem. It's a WEB system.
When I search for a client it fills in all the fields I need to correct, but when I look for another client I get the following error message: The strangest thing is that the fields are correct, string - string, float - float, etc ...
java.lang.IllegalArgumentException: paciente.profissao
I looked up several things about this including posts here from SOpt and I could not come up with a solution.
Error shown in stracktrace:
Set 23, 2014 9:27:02 AM javax.faces.component.UIViewRoot broadcastEvents
SEVERE: AbortProcessingException thrown when processing event of type 'javax.faces.event.ValueChangeEvent' during phase 'PROCESS_VALIDATIONS 3' for component with ID or Client ID of 'listbox1'
Set 23, 2014 9:27:02 AM javax.faces.component.UIViewRoot broadcastEvents
SEVERE: javax.faces.event.AbortProcessingException: /medico/prontuario.jsp(816,127) '#{medico$prontuario.listbox1_processValueChange}' java.lang.IllegalArgumentException: endereco_paciente.logradouro
javax.faces.event.AbortProcessingException: /medico/prontuario.jsp(816,127) '#{medico$prontuario.listbox1_processValueChange}' java.lang.IllegalArgumentException: endereco_paciente.logradouro
at com.sun.webui.jsf.event.MethodExprValueChangeListener.processValueChange(MethodExprValueChangeListener.java:73)
at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:123)
at com.sun.webui.jsf.component.WebuiInput.broadcast(WebuiInput.java:209)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:416)
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.faces.extensions.avatar.components.PartialTraversalViewRootHelper.broadcastEvents(PartialTraversalViewRootHelper.java:500)
at com.sun.faces.extensions.avatar.components.PartialTraversalViewRootHelper.processValidators(PartialTraversalViewRootHelper.java:267)
at com.sun.faces.extensions.avatar.components.PartialTraversalViewRootImpl.processValidators(PartialTraversalViewRootImpl.java:152)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalArgumentException: endereco_paciente.logradouro
at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKeyInternal(CachedRowSetDataProvider.java:555)
at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKey(CachedRowSetDataProvider.java:513)
at com.sun.data.provider.impl.AbstractDataProvider.getValue(AbstractDataProvider.java:97)
at yagaonline.medico.prontuario.listbox1_processValueChange(prontuario.java:3660)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
at com.sun.webui.jsf.event.MethodExprValueChangeListener.processValueChange(MethodExprValueChangeListener.java:71)
... 32 more
Set 23, 2014 9:27:02 AM javax.faces.component.UIViewRoot broadcastEvents
SEVERE: AbortProcessingException thrown when processing event of type 'javax.faces.event.ValueChangeEvent' during phase 'PROCESS_VALIDATIONS 3' for component with ID or Client ID of 'listbox1'
Set 23, 2014 9:27:02 AM javax.faces.component.UIViewRoot broadcastEvents
SEVERE: javax.faces.event.AbortProcessingException: /medico/prontuario.jsp(816,127) '#{medico$prontuario.listbox1_processValueChange}' java.lang.IllegalArgumentException: paciente.indicado
javax.faces.event.AbortProcessingException: /medico/prontuario.jsp(816,127) '#{medico$prontuario.listbox1_processValueChange}' java.lang.IllegalArgumentException: paciente.indicado
at com.sun.webui.jsf.event.MethodExprValueChangeListener.processValueChange(MethodExprValueChangeListener.java:73)
at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:123)
at com.sun.webui.jsf.component.WebuiInput.broadcast(WebuiInput.java:209)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:416)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:663)
at com.sun.faces.extensions.avatar.components.PartialTraversalViewRootImpl.processValidators(PartialTraversalViewRootImpl.java:153)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalArgumentException: paciente.indicado
at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKeyInternal(CachedRowSetDataProvider.java:555)
at com.sun.data.provider.impl.CachedRowSetDataProvider.getFieldKey(CachedRowSetDataProvider.java:513)
at com.sun.data.provider.impl.AbstractDataProvider.getValue(AbstractDataProvider.java:97)
at yagaonline.medico.prontuario.listbox1_processValueChange(prontuario.java:3658)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
at com.sun.webui.jsf.event.MethodExprValueChangeListener.processValueChange(MethodExprValueChangeListener.java:71)
... 28 more
This message was edited 2 times. Last update was at 23/09/2014 09:29:11
My code.
try {
getSessionBean1().getPesqcodpacienteRowSet1().setObject(1, listbox1.getSelected());
pacienteDataProvider1.refresh();
// info("listbox");
Integer paciente = (Integer) pacienteDataProvider1.getValue("paciente.codigo");
String nome_paciente = (String) pacienteDataProvider1.getValue("paciente.nome");
//guarda o código do paciente selecionado na seção
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
session.setAttribute("cod_paciente", paciente);
info("paciente" + paciente);
stmens.setText("teste código ok!");
nome.setText(nome_paciente);
tabSet1.setVisible(true);
//busca e carrega os dados do paciente para todas as tabelas de dados
getSessionBean1().getAlterapacienteRowSet1().setObject(1, paciente);
pacienteDataProvider2.refresh();
getSessionBean1().getPesqendereco_pacienteRowSet1().setObject(1, paciente);
endereco_pacienteDataProvider.refresh();
getSessionBean1().getPesqtelefone_pacienteRowSet1().setObject(1, paciente);
telefone_pacienteDataProvider.refresh();
getSessionBean1().getAnamneseRowSet().setObject(1, paciente);
anamneseDataProvider.refresh();
getSessionBean1().getHistorico_atestadoRowSet().setObject(1, paciente);
historico_atestadoDataProvider.refresh();
getSessionBean1().getPesqbioimpedanciometriaRowSet1().setObject(1, paciente);
pesqbioimpedanciometriaDataProvider1.refresh();
getSessionBean1().getPesqhistorico_consultaRowSet1().setObject(1, paciente);
pesqhistorico_consultaDataProvider1.refresh();
getSessionBean1().getPesqhistorico_dietaRowSet1().setObject(1, paciente);
pesqhistorico_dietaDataProvider1.refresh();
getSessionBean1().getPesqhistorico_examesRowSet1().setObject(1, paciente);
pesqhistorico_examesDataProvider1.refresh();
getSessionBean1().getFotosantesRowSet1().setObject(1, paciente);
fotosantesDataProvider1.refresh();
getSessionBean1().getFotosdepoisRowSet1().setObject(1, paciente);
fotosdepoisDataProvider1.refresh();
getSessionBean1().getLista_historico_procedimentosRowSet1().setObject(1, paciente);
lista_historico_procedimentosDataProvider1.refresh();
Integer validaresult2 = telefone_pacienteDataProvider.getRowCount();
// info("result deo tel "+validaresult2);
listbox1.setVisible(false);
if (validaresult2 == 1) {
addtel.setVisible(true);
DDD1.setVisible(true);
tel1.setVisible(true);
stxddd.setVisible(true);
stxnum.setVisible(true);
stxtipo.setVisible(true);
tipotel1.setVisible(true);
DDD2.setVisible(true);
tel2.setVisible(true);
stxddd1.setVisible(true);
stxnum1.setVisible(true);
stxtipo1.setVisible(true);
tipotel2.setVisible(true);
btn_tel.setVisible(true);
}
if (validaresult2 == 3) {
addtel.setVisible(false);
DDD1.setVisible(false);
tel1.setVisible(false);
stxddd.setVisible(false);
stxnum.setVisible(false);
stxtipo.setVisible(false);
tipotel1.setVisible(false);
DDD2.setVisible(false);
tel2.setVisible(false);
stxddd1.setVisible(false);
stxnum1.setVisible(false);
stxtipo1.setVisible(false);
tipotel2.setVisible(false);
btn_tel.setVisible(false);
}
if (validaresult2 == 2) {
addtel.setVisible(true);
DDD1.setVisible(true);
tel1.setVisible(true);
stxddd.setVisible(true);
stxnum.setVisible(true);
stxtipo.setVisible(true);
tipotel1.setVisible(true);
btn_tel.setVisible(true);
DDD2.setVisible(false);
tel2.setVisible(false);
stxddd.setVisible(false);
stxnum.setVisible(false);
stxtipo.setVisible(false);
tipotel2.setVisible(false);
}
String cpf1 = (String) pacienteDataProvider2.getValue("paciente.cpf");
String nome1 = (String) pacienteDataProvider2.getValue("paciente.nome");
info("nome " + nome1);
String profissao1 = (String) pacienteDataProvider2.getValue("paciente.profissao");
info("profissao " + profissao1);
String email1 = (String) pacienteDataProvider2.getValue("paciente.email");
info(email1);
String indicado1 = (String) pacienteDataProvider2.getValue("paciente.indicado");
info(indicado1);
String rua = (String) pacienteDataProvider2.getValue("endereco_paciente.logradouro");
info(rua);
String bairro1 = (String) pacienteDataProvider2.getValue("endereco_paciente.bairro");
info(bairro1);
String cidade1 = (String) pacienteDataProvider2.getValue("endereco_paciente.cidade");
info(cidade1);
String cep1 = (String) pacienteDataProvider2.getValue("endereco_paciente.cep");
info(cep1);
String complemento1 = (String) pacienteDataProvider2.getValue("endereco_paciente.complemento");
info(complemento1);
Float num1 = (Float) pacienteDataProvider2.getValue("endereco_paciente.numero");
info("" + num1);
String observacoes1 = (String) pacienteDataProvider2.getValue("paciente.observacoes");
info(observacoes1);
Date datanasc = (Date) pacienteDataProvider2.getValue("paciente.nascimento");
info("" + datanasc);
String sexo1 = (String) pacienteDataProvider2.getValue("paciente.sexo");
info(sexo1);
String civil = (String) pacienteDataProvider2.getValue("paciente.estado_civil");
info(civil);
String indica = (String) pacienteDataProvider2.getValue("paciente.tipo_indicado");
info(indica);
cpf.setText(cpf1);
nome2.setText(nome1);
profissao.setText(profissao1);
email.setText(email1);
indicado.setText(indicado1);
// indica2.setText(indica);
lougradouro.setText(rua);
bairro.setText(bairro1);
cidade.setText(cidade1);
complement.setText(complemento1);
numero.setText(num1);
data_nasc.setText(datanasc);
observacoes.setText(observacoes1);
cep.setText(cep1);
txtsexo.setText(sexo1);
txtestado.setText(civil);
} catch (SQLException ex) {
error("erro no list" + ex);
}