JSF(gravar)

5 respostas
gisa_screen

erro ao agravar os dados do cadastro…

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
javax.faces.webapp.FacesServlet.service(FacesServlet.java:323)

root cause

javax.faces.el.EvaluationException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

javax.faces.component.UICommand.broadcast(UICommand.java:387)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:764)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1185)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)

root cause

org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)

org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)

org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)

org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)

org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)

org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)

org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)

org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)

org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)

org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)

org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)

org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)

locadora.dominio.persistencia.ClienteDao.alterar(ClienteDao.java:40)

locadora.controle.ClienteMb.salvar(ClienteMb.java:89)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.apache.el.parser.AstValue.invoke(AstValue.java:172)

org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)

javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

javax.faces.component.UICommand.broadcast(UICommand.java:387)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:764)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1185)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.


Apache Tomcat/6.0.20

O que será q esta acontecendo??? se tiver alguem no domingo, estudando Java rs…me responda , por favor!?

5 Respostas

gledson85
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

Ou tem uma coluna a mais ou uma a menos na hora de salvar seu bean.

gisa_screen

esse problema eu resolvi, tirei esta linha…

<h:inputHidden id=“id” value="#{clienteMb.cliente.id}" /> da página de cadastro…

ja estou cadastrando no banco…

agora o erro é pra logar…aff :cry:

gisa_screen

agora esse erro q nao consegui resolver…

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NullPointerException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:323)

root cause

javax.faces.el.EvaluationException: java.lang.NullPointerException

javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

javax.faces.component.UICommand.broadcast(UICommand.java:387)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:764)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1185)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)

root cause

java.lang.NullPointerException

locadora.controle.LoginMb.logar(LoginMb.java:31)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.apache.el.parser.AstValue.invoke(AstValue.java:172)

org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)

javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

javax.faces.component.UICommand.broadcast(UICommand.java:387)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:764)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1185)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.


Apache Tomcat/6.0.20

me ajudem!

gledson85

Conseguiu resolver?

edysnipes

Já conseguiu resolver?

Coloque o código desse arquivo:

locadora.controle.LoginMb.logar(LoginMb.java:31)

e o erro novamente.

Criado 13 de junho de 2010
Ultima resposta 16 de jun. de 2010
Respostas 5
Participantes 3