[Resolvido] Dúvida Datas em V-Raptor e Hibernate

Olá Gujeiros, comecei a estudar Java Web e V-Raptor a pouco tempo, estou acompanhando a apostila FJ-28 da Caelum mas fazendo um exemplo próprio com base na apostila. Criei um formulário de cadastro e quando clico no botão “Enviar” ocorre o seguinte erro:

22:14:45,156 DEBUG [ToInstantiateInterceptorHandler] Invoking interceptor ParametersInstantiatorInterceptor 22:14:45,171 DEBUG [JstlLocalization ] couldn't find message bundle, creating an empty one 22:14:45,171 DEBUG [AsmBasedTypeCreator ] Trying to make class for ClienteController$adiciona$1171405073$1 22:14:45,203 DEBUG [ParanamerNameProvider] Found parameter names with paranamer for ClienteController.adiciona(Cliente) as [cliente] 22:14:45,203 DEBUG [AsmBasedTypeCreator ] Parameter names found for creating type are: [Cliente] 22:14:45,203 DEBUG [AsmBasedTypeCreator ] Method for field 'Cliente' being defined for type Lbr/bmweb/pojo/Cliente; 22:14:45,203 DEBUG [AsmBasedTypeCreator ] Methods: [public void ClienteController$adiciona$1171405073$1.setCliente(br.bmweb.pojo.Cliente), public br.bmweb.pojo.Cliente ClienteController$adiciona$1171405073$1.getCliente()] 22:14:45,203 DEBUG [AsmBasedTypeCreator ] Fields: [private br.bmweb.pojo.Cliente ClienteController$adiciona$1171405073$1.Cliente_] 22:14:45,203 DEBUG [CacheBasedTypeCreator] cached generic type for method [DefaultResourceMethod: ClienteController.adicionaClienteController.adiciona(Cliente)] 22:14:45,234 DEBUG [OgnlParametersProvider] Applying cliente.placa with [Placa] 22:14:45,281 DEBUG [OgnlParametersProvider] Applying cliente.mercado with [Mercado] 22:14:45,281 DEBUG [OgnlParametersProvider] Applying cliente.rg with [123] 22:14:45,281 DEBUG [OgnlParametersProvider] Applying cliente.data_nascimento with [10-07-1987] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.contato with [Ciclano] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.newsletter with [S] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.email with [cristiano@123] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.documento with [123] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.profissao with [Teste] 22:14:45,296 DEBUG [OgnlParametersProvider] Applying cliente.nome with [Cristiano] 22:14:45,312 DEBUG [OgnlParametersProvider] Applying cliente.data_cadastro with [10-01-2000] 22:14:45,312 DEBUG [ParanamerNameProvider] Found parameter names with paranamer for ClienteController.adiciona(Cliente) as [cliente] 22:14:45,312 DEBUG [ParametersInstantiatorInterceptor] Parameter values for [DefaultResourceMethod: ClienteController.adicionaClienteController.adiciona(Cliente)] are [br.bmweb.pojo.Cliente@1fa269b] 22:14:45,343 DEBUG [ToInstantiateInterceptorHandler] Invoking interceptor ExecuteMethodInterceptor 22:14:45,343 DEBUG [ExecuteMethodInterceptor] Invoking ClienteController.adiciona(Cliente) Hibernate: select max(CL_COD_CLIENTE) from TB_CLIENTE Hibernate: insert into TB_CLIENTE (CL_DOCUMENTO, CL_RG, CL_NOME, CL_CONTATO, CL_MERCADO, CL_PLACA, CL_EMAIL, CL_PROFISSAO, CL_DATA_NASCIMENTO, CL_DATA_CADASTRO, CL_NEWS_LETTER, CL_COD_CLIENTE) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 12/03/2010 22:14:45 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet default threw exception br.com.caelum.vraptor.InterceptionException: an exception was raised while executing resource method at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:86) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42) at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:80) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70) at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92) at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56) at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89) 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:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Unknown Source) Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at br.bmweb.dao.ClienteDao.salva(ClienteDao.java:23) at br.bmweb.controller.ClienteController.adiciona(ClienteController.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:57) ... 37 more Caused by: java.sql.BatchUpdateException: Column 'CL_DATA_NASCIMENTO' cannot be null at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1693) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1108) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 51 more

Minha classe ClienteDao está assim:

[code]package br.bmweb.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.Transaction;

import br.bmweb.pojo.;
import br.bmweb.util.
;
import br.com.caelum.vraptor.ioc.Component;

@Component
public class ClienteDao {
private final Session session;
public ClienteDao(){
this.session=AbreSession.getSession();
}

public ClienteDao salva(Cliente cliente) {
	Transaction tx = session.beginTransaction();
	session.save(cliente);
	tx.commit();
	session.close();
	return null;
}
public ClienteDao removeCliente(Cliente cliente){
	Cliente cliente2 = (Cliente) session.load(Cliente.class, 1L);
	Transaction tx = session.beginTransaction();
	session.delete(cliente2);
	tx.commit();
	session.close();
	return null;
}

public List<Cliente>listaTudo(){
	return this.session.createCriteria(Cliente.class).list();
}

}
[/code]

Minha classe ClienteController está assim:

[code]package br.bmweb.controller;

import java.util.List;

import br.bmweb.dao.ClienteDao;
import br.bmweb.pojo.Cliente;
import br.com.caelum.vraptor.Resource;

@Resource
public class ClienteController {
private final ClienteDao dao;
public ClienteController(ClienteDao dao){
this.dao=dao;
}

public List<Cliente>lista(){
	return dao.listaTudo();
}
public void formulario(){
}

public void adiciona(Cliente cliente){
	ClienteDao dao = new ClienteDao();
	dao.salva(cliente);
	}

}[/code]

Meu formulario.jsp está assim:

[code]<%@ page language=“java” contentType=“text/html; charset=ISO-8859-1”
pageEncoding=“ISO-8859-1”%>

<%@ taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core”%>

Cadastro de Clientes Adicionar Cliente Documento:
RG:
Nome:
Contato:
Mercado:
Placa:
E-mail:
Profissão:
Data Nascimento:
Data Cadastro:
NewsLetter:
Enviar [/code]

Pelo que notei o método “adiciona” da classe ClienteController está sendo setado com valor nulo. Devo modificar o método “adiciona” para que capture os dados do formulário? Como contornar este problema utilizando V-Raptor?

cliente == null ou cliente.getDataNascimento() == null?

o setter da data de nascimento é setDataNascimento() ou setData_nascimento()??

se for do primeiro jeito, vc precisa trocar os nomes dos inputs pra cliente.dataNascimento, cliente.dataCadastro, etc

[quote=Lucas Cavalcanti]cliente == null ou cliente.getDataNascimento() == null?

o setter da data de nascimento é setDataNascimento() ou setData_nascimento()??

se for do primeiro jeito, vc precisa trocar os nomes dos inputs pra cliente.dataNascimento, cliente.dataCadastro, etc[/quote]

Pelo que vi o problema é com os dois campos do tipo data que não estão sendo setados, em minha tabela do banco de dados esses campos de datas estão para ser NOT NULL, fiz um teste deixando para esses campos aceitarem nulos e tudo funcionou perfeitamente. Minha classe Cliente está assim:

[code]package br.bmweb.pojo;

import java.util.Date;

public class Cliente {
private int cod_cliente;
private String documento, rg, nome, contato, mercado, placa, email, profissao, newsletter;
private Date data_nascimento, data_cadastro;
public int getCod_cliente() {
return cod_cliente;
}
public void setCod_cliente(int codCliente) {
cod_cliente = codCliente;
}
public String getDocumento() {
return documento;
}
public void setDocumento(String documento) {
this.documento = documento;
}
public String getRg() {
return rg;
}
public void setRg(String rg) {
this.rg = rg;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getContato() {
return contato;
}
public void setContato(String contato) {
this.contato = contato;
}
public String getMercado() {
return mercado;
}
public void setMercado(String mercado) {
this.mercado = mercado;
}
public String getPlaca() {
return placa;
}
public void setPlaca(String placa) {
this.placa = placa;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getProfissao() {
return profissao;
}
public void setProfissao(String profissao) {
this.profissao = profissao;
}
public String getNewsletter() {
return newsletter;
}
public void setNewsletter(String newsletter) {
this.newsletter = newsletter;
}
public Date getData_nascimento() {
return data_nascimento;
}
public void setData_nascimento(Date dataNascimento) {
data_nascimento = dataNascimento;
}
public Date getData_cadastro() {
return data_cadastro;
}
public void setData_cadastro(Date dataCadastro) {
data_cadastro = dataCadastro;
}
}
[/code]

Nos inputs do meu JSP até tentei mudar deixando assim mas também não funcionou:

<label for="data_nascimento">Data Nascimento:</label> <input id="data_nascimento" type="text" name="cliente.Data_nascimento" /> <br> <label for="data_cadastro">Data Cadastro:</label> <input id="data_cadastro" type="text" name="cliente.Data_cadastro" />

o que vc tá digitando nos inputs?

Digitei uma data já no formato do MySQL como por exemplo 2010-02-16. Na minha classe ClienteController mandei retornar os valores setados e o console retornou o seguinte:

14:27:29,609 DEBUG [ToInstantiateInterceptorHandler] Invoking interceptor ParametersInstantiatorInterceptor 14:27:29,609 DEBUG [JstlLocalization ] couldn't find message bundle, creating an empty one 14:27:29,609 DEBUG [AsmBasedTypeCreator ] Trying to make class for ClienteController$adiciona$1171405073$1 14:27:29,656 DEBUG [ParanamerNameProvider] Found parameter names with paranamer for ClienteController.adiciona(Cliente) as [cliente] 14:27:29,656 DEBUG [AsmBasedTypeCreator ] Parameter names found for creating type are: [Cliente] 14:27:29,656 DEBUG [AsmBasedTypeCreator ] Method for field 'Cliente' being defined for type Lbr/bmweb/pojo/Cliente; 14:27:29,656 DEBUG [AsmBasedTypeCreator ] Methods: [public void ClienteController$adiciona$1171405073$1.setCliente(br.bmweb.pojo.Cliente), public br.bmweb.pojo.Cliente ClienteController$adiciona$1171405073$1.getCliente()] 14:27:29,656 DEBUG [AsmBasedTypeCreator ] Fields: [private br.bmweb.pojo.Cliente ClienteController$adiciona$1171405073$1.Cliente_] 14:27:29,656 DEBUG [CacheBasedTypeCreator] cached generic type for method [DefaultResourceMethod: ClienteController.adicionaClienteController.adiciona(Cliente)] 14:27:29,671 DEBUG [OgnlParametersProvider] Applying cliente.placa with [Teste] 14:27:29,734 DEBUG [OgnlParametersProvider] Applying cliente.mercado with [Teste] 14:27:29,734 DEBUG [OgnlParametersProvider] Applying cliente.rg with [123] 14:27:29,734 DEBUG [OgnlParametersProvider] Applying cliente.Nome with [Cristiano] 14:27:29,734 DEBUG [OgnlParametersProvider] Applying cliente.data_nascimento with [10-07-1987] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.contato with [Teste] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.newsletter with [S] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.email with [cristiano@123] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.documento with [123] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.profissao with [Teste] 14:27:29,750 DEBUG [OgnlParametersProvider] Applying cliente.data_cadastro with [10-01-2000] 14:27:29,765 DEBUG [ParanamerNameProvider] Found parameter names with paranamer for ClienteController.adiciona(Cliente) as [cliente] 14:27:29,765 DEBUG [ParametersInstantiatorInterceptor] Parameter values for [DefaultResourceMethod: ClienteController.adicionaClienteController.adiciona(Cliente)] are [br.bmweb.pojo.Cliente@1a01f91] 14:27:29,796 DEBUG [ToInstantiateInterceptorHandler] Invoking interceptor ExecuteMethodInterceptor 14:27:29,796 DEBUG [ExecuteMethodInterceptor] Invoking ClienteController.adiciona(Cliente) Valor de Nome: Cristiano Valor Documento:123 Valor RG:123 Valor Contato:Teste Valor Email:cristiano@123 Valor Mercado:Teste Valor NewsLetter:S Valor Placa:Teste Valor Profissao:Teste Valor Data Cadastro:null Valor Data Nascimento:null Hibernate: select max(CL_COD_CLIENTE) from TB_CLIENTE Hibernate: insert into TB_CLIENTE (CL_DOCUMENTO, CL_RG, CL_NOME, CL_CONTATO, CL_MERCADO, CL_PLACA, CL_EMAIL, CL_PROFISSAO, CL_DATA_NASCIMENTO, CL_DATA_CADASTRO, CL_NEWS_LETTER, CL_COD_CLIENTE) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 13/03/2010 14:27:30 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet default threw exception br.com.caelum.vraptor.InterceptionException: an exception was raised while executing resource method at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:86) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42) at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:47) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:80) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:65) at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70) at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92) at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56) at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89) 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:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Unknown Source) Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at br.bmweb.dao.ClienteDao.salva(ClienteDao.java:23) at br.bmweb.controller.ClienteController.adiciona(ClienteController.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:57) ... 37 more Caused by: java.sql.BatchUpdateException: Column 'CL_DATA_NASCIMENTO' cannot be null at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1693) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1108) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 51 more
Repare que as duas datas estão setadas com null, mas se vc olhar mais no começo do Log vai ver que no meu formulário inseri os valores 10-07-1987 e 10-01-2000. Será que é algum problema com os nomes dos métodos get e set da classe Cliente?

o VRaptor tenta converter essa data pra Date (que foi o que vc colocou na entidade)… e vc tem que seguir o padrão do seu locale… tenta gravar com 02/03/2010 e vê se vai não nulo

Nossa cara funcionou, esse pequeno detalhe da data eu não sabia :lol: . Obrigado.