Firebird autoincrement JPA

Ola galera ja criei os generator e vinculei às triggers criei as Annotation como encontrei na net porem não
consegui fazer o autoincremente criado no Firebird funioncar com JPA.

Criação da trigger e do generator:

CREATE GENERATOR aut_cod_usuario;

CREATE TRIGGER trigger_cod_usuario FOR usuario
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
 NEW.usu_codigo = GEN_ID(aut_cod_usuario, 1);
END;

Minha entidade:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author rh
 */
@Entity
@Table(name = "USUARIO")
@SequenceGenerator( name = "SEQ", sequenceName = "AUT_COD_USUARIO", allocationSize = 1)
@NamedQueries({@NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"), @NamedQuery(name = "Usuario.findByUsuCodigo", query = "SELECT u FROM Usuario u WHERE u.usuCodigo = :usuCodigo"), @NamedQuery(name = "Usuario.findByUsuUsuario", query = "SELECT u FROM Usuario u WHERE u.usuUsuario = :usuUsuario"), @NamedQuery(name = "Usuario.findByUsuSenha", query = "SELECT u FROM Usuario u WHERE u.usuSenha = :usuSenha")})
public class Usuario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "SEQ" )
    @Column(name = "USU_CODIGO")
    private Integer usuCodigo;
    @Basic(optional = false)
    @Column(name = "USU_USUARIO")
    private String usuUsuario;
    @Basic(optional = false)
    @Column(name = "USU_SENHA")
    private String usuSenha;

    public Usuario() {
    }

    public Usuario(Integer usuCodigo) {
        this.usuCodigo = usuCodigo;
    }

    public Usuario(Integer usuCodigo, String usuUsuario, String usuSenha) {
        this.usuCodigo = usuCodigo;
        this.usuUsuario = usuUsuario;
        this.usuSenha = usuSenha;
    }

    public Integer getUsuCodigo() {
        return usuCodigo;
    }

    public void setUsuCodigo(Integer usuCodigo) {
        this.usuCodigo = usuCodigo;
    }

    public String getUsuUsuario() {
        return usuUsuario;
    }

    public void setUsuUsuario(String usuUsuario) {
        this.usuUsuario = usuUsuario;
    }

    public String getUsuSenha() {
        return usuSenha;
    }

    public void setUsuSenha(String usuSenha) {
        this.usuSenha = usuSenha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (usuCodigo != null ? usuCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuario)) {
            return false;
        }
        Usuario other = (Usuario) object;
        if ((this.usuCodigo == null && other.usuCodigo != null) || (this.usuCodigo != null && !this.usuCodigo.equals(other.usuCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Beans.Usuario[usuCodigo=" + usuCodigo + "]";
    }

}

O erro que acontece é o seguinte:

Ou seja o campo codigo da minha entidade não esta assumindo nenhum valor. Alguma dica?
Obrigado!

Exclua essa trigger, não é necessário utilizá-la. O Hibernate cuida de gerar o próximo número para você.
No mais, essa NullPointerException pode ser qualquer outra coisa. Poste o stacktrace aqui.

Este é meu metodo Salvar: O Campo codigo no beanUsuario eu não preencho pois ele é autoincrement sendo assim ele fica nulo, e o campo codigo no banco de dados não pode ser null. No Mysql eu so colocava a Annotation
@GeneratedValue(strategy = GenerationType.IDENTITY)

public void Salvar() { try { beanUsuario = new Usuario(); beanUsuario.setUsuUsuario(jtfUsuario.getText()); beanUsuario.setUsuSenha(jpsfSenha.getText()); Conexao.Salvar(beanUsuario); } catch (Exception ex) { Logger.getLogger(FrmAcesso.class.getName()).log(Level.SEVERE, null, ex); } }

Este é o stacktrace:

run:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
27/05/2009 09:15:03 Visao.Cadastros.FrmAcesso Salvar
SEVERE: null
java.lang.NullPointerException
        at Persistencia.Conexao.Salvar(Conexao.java:58)
        at Visao.Cadastros.FrmAcesso.Salvar(FrmAcesso.java:134)
        at HerancaVisual.MasterCadastro.jbSalvarActionPerformed(MasterCadastro.java:147)
        at HerancaVisual.MasterCadastro.access$000(MasterCadastro.java:21)
        at HerancaVisual.MasterCadastro$1.actionPerformed(MasterCadastro.java:49)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6134)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5899)
        at java.awt.Container.processEvent(Container.java:2023)
        at java.awt.Component.dispatchEventImpl(Component.java:4501)
        at java.awt.Container.dispatchEventImpl(Container.java:2081)
        at java.awt.Component.dispatchEvent(Component.java:4331)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
        at java.awt.Container.dispatchEventImpl(Container.java:2067)
        at java.awt.Window.dispatchEventImpl(Window.java:2458)
        at java.awt.Component.dispatchEvent(Component.java:4331)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Veja:

at Persistencia.Conexao.Salvar(Conexao.java:58)

Posta aí o código do método Conexao.Salvar, indicando qual é a linha de número 58.

Estes são os metodos:

[code]public static EntityManager getConexao() throws Exception {
try {
if (factory == null) {
factory = Persistence.createEntityManagerFactory(“CentroPecaPU”);
}
setStatus(true);
return factory.createEntityManager();
} catch (Exception e) {
throw new Exception(“Erro ao se Conectar \n” + e);
}
}

/**
 * método responsável por persistir o objeto no banco
 * @param objeto Objeto a ser persistido no banco
 * @param manager objeto que contém a transação
 * @throws java.lang.Exception Lança uma exception
 */
public static void Salvar(Object objeto) throws Exception {
    EntityManager manager = null;
    try {
        manager = Conexao.getConexao();
        manager.getTransaction().begin();
        manager.persist(objeto);
        manager.getTransaction().commit();
    } catch (Exception e) {
        manager.getTransaction().rollback();
        e.printStackTrace();
        throw new Exception("Erro ao Incluir \n" + e);
    }
}[/code]

na Entity o campo codigo esta assim oh:

@Id @Basic(optional = false) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ" ) @SequenceGenerator(name = "SEQ", sequenceName = "AUT_COD_USUARIO", allocationSize = 1) @Column(name = "USU_CODIGO") private Integer usuCodigo;

Qual dessas linhas é a linha 58 do seu código?

manager = Conexao.getConexao(); manager.getTransaction().begin(); manager.persist(objeto); manager.getTransaction().commit();

A LINHA 58 é essa!

manager.getTransaction().rollback(); 

agora olha como esta ficando meus StrackTrace:

run: 27/05/2009 15:46:26 org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA 27/05/2009 15:46:26 org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.2.5 27/05/2009 15:46:26 org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found 27/05/2009 15:46:26 org.hibernate.cfg.Environment buildBytecodeProvider INFO: Bytecode provider name : cglib 27/05/2009 15:46:26 org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling 27/05/2009 15:46:26 org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.3.2.GA 27/05/2009 15:46:30 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Bairro 27/05/2009 15:46:30 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Bairro.findAll => SELECT b FROM Bairro b 27/05/2009 15:46:30 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Bairro.findByBaiCodigo => SELECT b FROM Bairro b WHERE b.baiCodigo = :baiCodigo 27/05/2009 15:46:30 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Bairro.findByBaiDescricao => SELECT b FROM Bairro b WHERE b.baiDescricao = :baiDescricao 27/05/2009 15:46:30 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Bairro on table BAIRRO 27/05/2009 15:46:31 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Estoque 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findAll => SELECT e FROM Estoque e 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findByProdCodigo => SELECT e FROM Estoque e WHERE e.prodCodigo = :prodCodigo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findByEstQuantidade => SELECT e FROM Estoque e WHERE e.estQuantidade = :estQuantidade 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findByEstDataMovimentacao => SELECT e FROM Estoque e WHERE e.estDataMovimentacao = :estDataMovimentacao 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findByEstCodigoBarra => SELECT e FROM Estoque e WHERE e.estCodigoBarra = :estCodigoBarra 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estoque.findByEstValidade => SELECT e FROM Estoque e WHERE e.estValidade = :estValidade 27/05/2009 15:46:31 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Estoque on table ESTOQUE 27/05/2009 15:46:31 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.SubGrupo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: SubGrupo.findAll => SELECT s FROM SubGrupo s 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: SubGrupo.findBySubgCodigo => SELECT s FROM SubGrupo s WHERE s.subgCodigo = :subgCodigo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: SubGrupo.findBySubgDescricao => SELECT s FROM SubGrupo s WHERE s.subgDescricao = :subgDescricao 27/05/2009 15:46:31 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.SubGrupo on table SUB_GRUPO 27/05/2009 15:46:31 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Produto 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findAll => SELECT p FROM Produto p 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdCodigo => SELECT p FROM Produto p WHERE p.prodCodigo = :prodCodigo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdDescricao => SELECT p FROM Produto p WHERE p.prodDescricao = :prodDescricao 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdEstoqueMinimo => SELECT p FROM Produto p WHERE p.prodEstoqueMinimo = :prodEstoqueMinimo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdEstoqueMaximo => SELECT p FROM Produto p WHERE p.prodEstoqueMaximo = :prodEstoqueMaximo 27/05/2009 15:46:31 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdAplicacao => SELECT p FROM Produto p WHERE p.prodAplicacao = :prodAplicacao 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdPrecoCusto => SELECT p FROM Produto p WHERE p.prodPrecoCusto = :prodPrecoCusto 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdPrecoVenda => SELECT p FROM Produto p WHERE p.prodPrecoVenda = :prodPrecoVenda 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdPorcentagem => SELECT p FROM Produto p WHERE p.prodPorcentagem = :prodPorcentagem 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Produto.findByProdLucroVenda => SELECT p FROM Produto p WHERE p.prodLucroVenda = :prodLucroVenda 27/05/2009 15:46:32 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Produto on table PRODUTO 27/05/2009 15:46:32 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Empresa 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findAll => SELECT e FROM Empresa e 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprCodigo => SELECT e FROM Empresa e WHERE e.emprCodigo = :emprCodigo 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprRezaoSocial => SELECT e FROM Empresa e WHERE e.emprRezaoSocial = :emprRezaoSocial 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprNomeFantasia => SELECT e FROM Empresa e WHERE e.emprNomeFantasia = :emprNomeFantasia 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprInscricaoEstadual => SELECT e FROM Empresa e WHERE e.emprInscricaoEstadual = :emprInscricaoEstadual 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprCnpj => SELECT e FROM Empresa e WHERE e.emprCnpj = :emprCnpj 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Empresa.findByEmprEmail => SELECT e FROM Empresa e WHERE e.emprEmail = :emprEmail 27/05/2009 15:46:32 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Empresa on table EMPRESA 27/05/2009 15:46:32 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Telefone 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Telefone.findAll => SELECT t FROM Telefone t 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Telefone.findByFoneCodigo => SELECT t FROM Telefone t WHERE t.foneCodigo = :foneCodigo 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Telefone.findByFoneNumero => SELECT t FROM Telefone t WHERE t.foneNumero = :foneNumero 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Telefone.findByFoneTipo => SELECT t FROM Telefone t WHERE t.foneTipo = :foneTipo 27/05/2009 15:46:32 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Telefone on table TELEFONE 27/05/2009 15:46:32 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Fornecedor 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findAll => SELECT f FROM Fornecedor f 27/05/2009 15:46:32 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findByFornCodigo => SELECT f FROM Fornecedor f WHERE f.fornCodigo = :fornCodigo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findByFornRazaoSocial => SELECT f FROM Fornecedor f WHERE f.fornRazaoSocial = :fornRazaoSocial 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findByFornInscricaoEstadual => SELECT f FROM Fornecedor f WHERE f.fornInscricaoEstadual = :fornInscricaoEstadual 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findByFornCnpj => SELECT f FROM Fornecedor f WHERE f.fornCnpj = :fornCnpj 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Fornecedor.findByFornEmail => SELECT f FROM Fornecedor f WHERE f.fornEmail = :fornEmail 27/05/2009 15:46:33 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Fornecedor on table FORNECEDOR 27/05/2009 15:46:33 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Logradouro 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Logradouro.findAll => SELECT l FROM Logradouro l 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Logradouro.findByLogCodigo => SELECT l FROM Logradouro l WHERE l.logCodigo = :logCodigo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Logradouro.findByLogDescricao => SELECT l FROM Logradouro l WHERE l.logDescricao = :logDescricao 27/05/2009 15:46:33 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Logradouro on table LOGRADOURO 27/05/2009 15:46:33 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Grupo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Grupo.findAll => SELECT g FROM Grupo g 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Grupo.findByGruCodigo => SELECT g FROM Grupo g WHERE g.gruCodigo = :gruCodigo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Grupo.findByGruDescricao => SELECT g FROM Grupo g WHERE g.gruDescricao = :gruDescricao 27/05/2009 15:46:33 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Grupo on table GRUPO 27/05/2009 15:46:33 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Unidade 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Unidade.findAll => SELECT u FROM Unidade u 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Unidade.findByUniCodigo => SELECT u FROM Unidade u WHERE u.uniCodigo = :uniCodigo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Unidade.findByUniDescricao => SELECT u FROM Unidade u WHERE u.uniDescricao = :uniDescricao 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Unidade.findByUniSigla => SELECT u FROM Unidade u WHERE u.uniSigla = :uniSigla 27/05/2009 15:46:33 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Unidade on table UNIDADE 27/05/2009 15:46:33 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Cep 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cep.findAll => SELECT c FROM Cep c 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cep.findByCepCodigo => SELECT c FROM Cep c WHERE c.cepCodigo = :cepCodigo 27/05/2009 15:46:33 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cep.findByCepNumero => SELECT c FROM Cep c WHERE c.cepNumero = :cepNumero 27/05/2009 15:46:33 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Cep on table CEP 27/05/2009 15:46:33 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.TipoLogradouro 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: TipoLogradouro.findAll => SELECT t FROM TipoLogradouro t 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: TipoLogradouro.findByTendCodigo => SELECT t FROM TipoLogradouro t WHERE t.tendCodigo = :tendCodigo 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: TipoLogradouro.findByTendDescricao => SELECT t FROM TipoLogradouro t WHERE t.tendDescricao = :tendDescricao 27/05/2009 15:46:34 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.TipoLogradouro on table TIPO_LOGRADOURO 27/05/2009 15:46:34 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Usuario 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Usuario.findAll => SELECT u FROM Usuario u 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Usuario.findByUsuCodigo => SELECT u FROM Usuario u WHERE u.usuCodigo = :usuCodigo 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Usuario.findByUsuUsuario => SELECT u FROM Usuario u WHERE u.usuUsuario = :usuUsuario 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Usuario.findByUsuSenha => SELECT u FROM Usuario u WHERE u.usuSenha = :usuSenha 27/05/2009 15:46:34 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Usuario on table USUARIO 27/05/2009 15:46:34 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Cidade 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cidade.findAll => SELECT c FROM Cidade c 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cidade.findByCidCodigo => SELECT c FROM Cidade c WHERE c.cidCodigo = :cidCodigo 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cidade.findByCidDescricao => SELECT c FROM Cidade c WHERE c.cidDescricao = :cidDescricao 27/05/2009 15:46:34 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Cidade on table CIDADE 27/05/2009 15:46:34 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Estado 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estado.findAll => SELECT e FROM Estado e 27/05/2009 15:46:34 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estado.findByEstCodigo => SELECT e FROM Estado e WHERE e.estCodigo = :estCodigo 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estado.findByEstDescricao => SELECT e FROM Estado e WHERE e.estDescricao = :estDescricao 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Estado.findByEstSigla => SELECT e FROM Estado e WHERE e.estSigla = :estSigla 27/05/2009 15:46:35 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Estado on table ESTADO 27/05/2009 15:46:35 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Endereco 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Endereco.findAll => SELECT e FROM Endereco e 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Endereco.findByEndCodigo => SELECT e FROM Endereco e WHERE e.endCodigo = :endCodigo 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Endereco.findByEndNumero => SELECT e FROM Endereco e WHERE e.endNumero = :endNumero 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Endereco.findByEndComplemento => SELECT e FROM Endereco e WHERE e.endComplemento = :endComplemento 27/05/2009 15:46:35 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Endereco on table ENDERECO 27/05/2009 15:46:35 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.Cliente 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findAll => SELECT c FROM Cliente c 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliCodigo => SELECT c FROM Cliente c WHERE c.cliCodigo = :cliCodigo 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliDataRegistro => SELECT c FROM Cliente c WHERE c.cliDataRegistro = :cliDataRegistro 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliNome => SELECT c FROM Cliente c WHERE c.cliNome = :cliNome 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliApelido => SELECT c FROM Cliente c WHERE c.cliApelido = :cliApelido 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliTipo => SELECT c FROM Cliente c WHERE c.cliTipo = :cliTipo 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliNascimento => SELECT c FROM Cliente c WHERE c.cliNascimento = :cliNascimento 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliCpfCnpj => SELECT c FROM Cliente c WHERE c.cliCpfCnpj = :cliCpfCnpj 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliInscricaoEstadual => SELECT c FROM Cliente c WHERE c.cliInscricaoEstadual = :cliInscricaoEstadual 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliEmail => SELECT c FROM Cliente c WHERE c.cliEmail = :cliEmail 27/05/2009 15:46:35 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliStatus => SELECT c FROM Cliente c WHERE c.cliStatus = :cliStatus 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliSituacao => SELECT c FROM Cliente c WHERE c.cliSituacao = :cliSituacao 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliLimiteCompra => SELECT c FROM Cliente c WHERE c.cliLimiteCompra = :cliLimiteCompra 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByCliObservacoes => SELECT c FROM Cliente c WHERE c.cliObservacoes = :cliObservacoes 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: Cliente.findByEndCobranca => SELECT c FROM Cliente c WHERE c.endCobranca = :endCobranca 27/05/2009 15:46:36 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.Cliente on table CLIENTE 27/05/2009 15:46:36 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.ProdutoFornecedor 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: ProdutoFornecedor.findAll => SELECT p FROM ProdutoFornecedor p 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: ProdutoFornecedor.findByCodFornecedorProduto => SELECT p FROM ProdutoFornecedor p WHERE p.codFornecedorProduto = :codFornecedorProduto 27/05/2009 15:46:36 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.ProdutoFornecedor on table PRODUTO_FORNECEDOR 27/05/2009 15:46:36 org.hibernate.cfg.AnnotationBinder bindClass INFO: Binding entity from annotated class: Beans.RamoAtividade 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: RamoAtividade.findAll => SELECT r FROM RamoAtividade r 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: RamoAtividade.findByRamCodigo => SELECT r FROM RamoAtividade r WHERE r.ramCodigo = :ramCodigo 27/05/2009 15:46:36 org.hibernate.cfg.annotations.QueryBinder bindQuery INFO: Binding Named query: RamoAtividade.findByRamDescricao => SELECT r FROM RamoAtividade r WHERE r.ramDescricao = :ramDescricao 27/05/2009 15:46:36 org.hibernate.cfg.annotations.EntityBinder bindTable INFO: Bind entity Beans.RamoAtividade on table RAMO_ATIVIDADE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Bairro.enderecoCollection -> ENDERECO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.SubGrupo.grupoCollection -> GRUPO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Produto.produtoFornecedorCollection -> PRODUTO_FORNECEDOR 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Empresa.telefoneCollection -> TELEFONE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Fornecedor.produtoFornecedorCollection -> PRODUTO_FORNECEDOR 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Fornecedor.telefoneCollection -> TELEFONE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Logradouro.enderecoCollection -> ENDERECO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Grupo.produtoCollection -> PRODUTO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Unidade.produtoCollection -> PRODUTO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Cep.enderecoCollection -> ENDERECO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.TipoLogradouro.enderecoCollection -> ENDERECO 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Cidade.cepCollection -> CEP 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Estado.cidadeCollection -> CIDADE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Endereco.clienteCollection -> CLIENTE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Endereco.empresaCollection -> EMPRESA 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Endereco.fornecedorCollection -> FORNECEDOR 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.Cliente.telefoneCollection -> TELEFONE 27/05/2009 15:46:37 org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass INFO: Mapping collection: Beans.RamoAtividade.empresaCollection -> EMPRESA 27/05/2009 15:46:37 org.hibernate.cfg.AnnotationConfiguration secondPassCompile INFO: Hibernate Validator not found: ignoring 27/05/2009 15:46:38 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) 27/05/2009 15:46:38 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 20 27/05/2009 15:46:38 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: true 27/05/2009 15:46:38 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebirdsql:localhost/3050:D:/BDPeca/BDPeca.fdb 27/05/2009 15:46:38 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=SYSDBA, password=****, autocommit=true, release_mode=auto} 27/05/2009 15:46:39 org.hibernate.cfg.SettingsFactory buildSettings INFO: RDBMS: Firebird 2.0.WI-V2.0.1.12855 Firebird 2.0/tcp (suporte)/P10, version: WI-V2.0.1.12855 Firebird 2.0.WI-V2.0.1.12855 Firebird 2.0/tcp (suporte)/P10 27/05/2009 15:46:39 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: Jaybird JCA/JDBC driver, version: 2.1 27/05/2009 15:46:39 Visao.Cadastros.FrmAcesso Salvar SEVERE: null java.lang.NullPointerException at Persistencia.Conexao.Salvar(Conexao.java:58) at Visao.Cadastros.FrmAcesso.Salvar(FrmAcesso.java:134) at HerancaVisual.MasterCadastro.jbSalvarActionPerformed(MasterCadastro.java:147) at HerancaVisual.MasterCadastro.access$000(MasterCadastro.java:21) at HerancaVisual.MasterCadastro$1.actionPerformed(MasterCadastro.java:49) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6134) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5899) at java.awt.Container.processEvent(Container.java:2023) at java.awt.Component.dispatchEventImpl(Component.java:4501) at java.awt.Container.dispatchEventImpl(Container.java:2081) at java.awt.Component.dispatchEvent(Component.java:4331) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895) at java.awt.Container.dispatchEventImpl(Container.java:2067) at java.awt.Window.dispatchEventImpl(Window.java:2458) at java.awt.Component.dispatchEvent(Component.java:4331) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Nossa, houve um erro dentro do bloco catch. Das duas uma; ou o objeto manager está setado como null, ou então o método getTransaction() está retornando null.

Faça o seguinte, troque a ordem das instruções do bloco catch para verificarmos o motivo do fluxo de execução ter entrado nele. Faça assim:

e.printStackTrace(); manager.getTransaction().rollback(); throw new Exception("Erro ao Incluir \n" + e);
Do jeito que o código está, ocorre uma exceção antes de você imprimir o stacktrace.