3 Replies Latest reply on Dec 27, 2007 5:37 PM by Pete Muir

    Seam Exception and Cannot open connection

    Diego Coronel Apprentice

      hi,

      im trying to throws exception in my bussines class and in my managedBean i want to make an update. My problem is that i think seam is closing my transaction.

      My ManagedBean --> my authenticate method is the problem

      package br.fpf.jdoctor.managedbean.seguranca;
      
      import javax.faces.application.FacesMessage;
      import javax.persistence.EntityNotFoundException;
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.faces.FacesMessages;
      import org.jboss.seam.security.Identity;
      
      import br.fpf.jdoctor.constants.UsuarioStatusConstant;
      import br.fpf.jdoctor.entitybean.seguranca.Usuario;
      import br.fpf.seguranca.businessrule.impl.exceptions.AutenticacaoException;
      import br.fpf.seguranca.businessrule.impl.exceptions.CifragemSenhaException;
      import br.fpf.seguranca.facade.ISegurancaFacade;
      
      /**
       * Classe responsavel pela autenticacao do usuario
       */
      @Name("authenticator")
      @Scope(ScopeType.SESSION)
      public class Authenticator {
      
       /**
       * Atributo que guardar informacoes sobre o login, inclusive login e password
       */
       @In
       private Identity identity;
      
       /**
       * Fachada responsavel pelas regras de negocio
       */
       @In (create=true, value="#{segurancaFacade}")
       private ISegurancaFacade segurancaFacade;
      
       /**
       * Atributo responsavel por mostrar as mensagens do sistema
       */
       @In
       private FacesMessages facesMessages;
      
       /**
       * Situacao do usuario apos logar
       */
       private int situacao;
      
       /**
       * Usuario Logado
       */
       private Usuario usuario;
      
       /**
       * Contador de tentativas de logar
       */
       private int tentativasDeLogar = 0;
      
       /**
       * Metodo que autentica o usuario
       */
       public boolean authenticate() {
       Usuario usuario = new Usuario();
       usuario.setTxLogin(identity.getUsername());
       usuario.setTxSenha(identity.getPassword());
       ++tentativasDeLogar;
       try {
       usuario = segurancaFacade.autenticarUsuario(usuario);
       situacao = usuario.getCsStatus();
       checkSituacao();
       return true;
       } catch (AutenticacaoException e) {
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.autenticacaoFalhou}");
       e.printStackTrace();
       } catch (CifragemSenhaException e) {
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.cifragemFalhou}");
       e.printStackTrace();
       }
       catch (Exception e){
       if (tentativasDeLogar == 2){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.duasTentivasInvalidas}");
       }
       if (tentativasDeLogar >= 3){
       if (tentativasDeLogar >= 3){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.usuarioFoiBloqueado}");
       segurancaFacade.bloquearUsuario(usuario); --> here im getting closed connection
       }
       }
       }
      
       return false;
       }
      
       public void checkSituacao(){
       if (situacao == UsuarioStatusConstant.ATIVO.getId()){
       //Verificar se precisa mostrar alguma mensagem especifica
       if (checkSenhaExpirada(getUsuario())){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.senhaExpirada}");
       situacao = UsuarioStatusConstant.SENHA_EXPIRADA.getId();
       }
       }
       else if (situacao == UsuarioStatusConstant.INATIVO.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.inativo}");
       }
       else if (situacao == UsuarioStatusConstant.BLOQUEADO.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.bloqueado}");
       }
       else if (situacao == UsuarioStatusConstant.CADASTRO_INCORRETO.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.rejeitado}");
       }
       else if (situacao == UsuarioStatusConstant.CADASTRO_REJEITADO.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.rejeitado}");
       }
       else if (situacao == UsuarioStatusConstant.CADASTRO_SOLICITADO.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.solicitado}");
       }
       else if (situacao == UsuarioStatusConstant.SENHA_REGERADA_PELO_ADMNISTRADOR.getId()){
       facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "#{msgLogin.senhaRegerada}");
       }
       }
      
       public boolean checkSenhaExpirada(Usuario usuario){
       // verificar tempo de duracao da senha
       return true;
       }
      
       public int getSituacao() {
       return situacao;
       }
      
       public void setSituacao(int situacao) {
       this.situacao = situacao;
       }
      
       public Usuario getUsuario() {
       return usuario;
       }
      
       public void setUsuario(Usuario usuario) {
       this.usuario = usuario;
       }
      
       public int getTentativasDeLogar() {
       return tentativasDeLogar;
       }
      
       public void setTentativasDeLogar(int tentativasDeLogar) {
       this.tentativasDeLogar = tentativasDeLogar;
       }
      
      
      }
      
      


      my bussiness class
      package br.fpf.seguranca.facade.impl;
      
      import java.util.Date;
      import java.util.HashSet;
      import java.util.Iterator;
      import java.util.List;
      import java.util.Set;
      
      import javax.persistence.EntityManager;
      import javax.persistence.EntityNotFoundException;
      
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.TransactionPropagationType;
      import org.jboss.seam.annotations.Transactional;
      
      import br.fpf.jdoctor.constants.UsuarioStatusConstant;
      import br.fpf.jdoctor.entitybean.seguranca.UnidadeOrganizacional;
      import br.fpf.jdoctor.entitybean.seguranca.Usuario;
      import br.fpf.jdoctor.entitybean.seguranca.UsuarioStatus;
      import br.fpf.jdoctor.entitybean.seguranca.UsuarioUndOrganizacional;
      import br.fpf.jdoctor.entitybean.seguranca.UsuarioUndOrganizacionalId;
      import br.fpf.jdoctor.interceptor.JDoctorLog;
      import br.fpf.seguranca.businessrule.impl.RNConsultasUsuario;
      import br.fpf.seguranca.businessrule.impl.RNListarTodasUnidadesOrganizacionaisAtivas;
      import br.fpf.seguranca.businessrule.impl.RNSenhaUtil;
      import br.fpf.seguranca.businessrule.impl.exceptions.AutenticacaoException;
      import br.fpf.seguranca.businessrule.impl.exceptions.CifragemSenhaException;
      import br.fpf.seguranca.businessrule.impl.exceptions.LoginUsuarioInexistente;
      import br.fpf.seguranca.facade.ISegurancaFacade;
      
      /**
       * Fachada do sistema de segurança
       */
      @JDoctorLog
      @Name("segurancaFacade")
      public class SegurancaFacade implements ISegurancaFacade {
      
       @In(create=true, value="#{entityManager}")
       private EntityManager em;
      
       @In(create=true)
       private RNConsultasUsuario rnConsultasUsuario;
      
       @In(create=true)
       private RNSenhaUtil rnSenhaUtil;
      
       @In(create=true, value="#{rnListarTodasUnidadesOrganizacionaisAtivas}")
       private RNListarTodasUnidadesOrganizacionaisAtivas listarUnidadesOrganizacionaisAtivas;
      
       /**
       * Gera nova senha para o usuário e a envia pelo email
       * @param usuario Objeto contendo o login do usuário
       * @throws CifragemSenhaException
       * @throws LoginUsuarioInexistente
       */
       public void gerarNovaSenha(Usuario usuario) throws CifragemSenhaException, LoginUsuarioInexistente {
      
       String login = usuario.getTxLogin();
       usuario = consultarUsuarioPorLogin(login);
      
       if (usuario != null) {
       // gera nova senha
       String novaSenha = rnSenhaUtil.gerarNovaSenha();
       // cifragem da nova senha
       String novaSenhaCifrada = rnSenhaUtil.cifrarSenha(novaSenha);
       // seta nova senha cifrada
       usuario.setTxSenha(novaSenhaCifrada);
       em.persist(usuario);
      
       // Falta nova senha enviar email
       // TODO enviar nova senha por email
       } else {
       throw new LoginUsuarioInexistente("Login inexistente: " + login);
       }
       }
      
       /**
       * Recupera um usuario de acordo com o login
       */
       public Usuario consultarUsuarioPorLogin(String login) {
       Usuario usuario = rnConsultasUsuario.obterUsuarioPorLogin(login);
       return usuario;
       }
      
       /**
       * Metodo que atualiza o status do usuario para bloqueado de acordo com o login
       * @param usuario
       */
       public void bloquearUsuario(Usuario usuario) throws EntityNotFoundException{
       usuario = rnConsultasUsuario.obterUsuarioPorLogin(usuario);
       usuario.setCsStatus(UsuarioStatusConstant.BLOQUEADO.getId());
      
       UsuarioStatus usuarioStatus = new UsuarioStatus();
       usuarioStatus.setCsStatus(UsuarioStatusConstant.BLOQUEADO.getId());
       usuarioStatus.setDtUsuarioStatus(new Date());
       usuarioStatus.setTxJustificativa("bloqueado por 3 tentativas invalidas");
       usuarioStatus.setUsuario(usuario);
       }
      
       /**
       * Salva os dados do usuário.
       * @param Usuario objeto usuário contendo os dados a serem salvos.
       */
       public void salvarUsuario(Usuario usuario) {
       em.persist(usuario);
       }
      
       /**
       * Salva a solicitacao de cadastro de um usuario
       */
       public void saveSolicitacaoCadastro(Usuario usuario, Set<UnidadeOrganizacional> und) throws CifragemSenhaException{
       usuario.setTxSenha(rnSenhaUtil.cifrarSenha(usuario.getTxSenha()));
       em.persist(usuario);
      
       Set<UsuarioUndOrganizacional> setUsuarioUnidade = new HashSet<UsuarioUndOrganizacional>();
      
       Iterator<UnidadeOrganizacional> it = und.iterator();
       while (it.hasNext()){
       UsuarioUndOrganizacional usuarioUnidade = new UsuarioUndOrganizacional();
      
       usuarioUnidade.setDtAlocacao(new Date());
       usuarioUnidade.setUnidadeOrganizacional(it.next());
       usuarioUnidade.setUsuario(usuario);
      
       UsuarioUndOrganizacionalId id = new UsuarioUndOrganizacionalId();
       id.setIdUnidadeOrganizacional(usuarioUnidade.getUnidadeOrganizacional().getIdUnidadeOrganizacional());
       id.setIdUsuario(usuario.getIdUsuario());
      
       usuarioUnidade.setId(id);
      
       setUsuarioUnidade.add(usuarioUnidade);
       }
      
       if ("".equals(usuario.getTxEmail())){
       usuario.setTxEmail(null);
       }
       usuario.setSysTipoUsuario(null);
       usuario.setUsuarioUndOrganizacionals(setUsuarioUnidade);
       usuario.setCsStatus(UsuarioStatusConstant.CADASTRO_SOLICITADO.getId());
      
       UsuarioStatus usuarioStatus = new UsuarioStatus();
       usuarioStatus.setDtUsuarioStatus(new Date());
       usuarioStatus.setUsuario(usuario);
       usuarioStatus.setCsStatus(UsuarioStatusConstant.CADASTRO_SOLICITADO.getId());
       usuarioStatus.setTxJustificativa("solicitação de cadastro");
      
       em.persist(usuarioStatus);
       em.merge(usuario);
       em.flush();
       }
      
       /**
       * Realiza cifragem de uma senha.
       * @param String senha a ser cifrada.
       * @throws CifragemSenhaException.
       */
       public String cifrarSenha(String senha) throws CifragemSenhaException {
       return rnSenhaUtil.cifrarSenha(senha);
       }
      
       /**
       * Metodo que valida o login e senha do usuario
       * @param usuario deverá estar preenchido com o login e a password para validar a autenticacao
       * @return usuario retorna todos os dados do usuario caso a autenticacao seja bem sucedida
       * @throws AutenticacaoException quando login ou senha não estiverem corretos
       * @throws CifragemSenhaException quando ocorrer algum problema na cifragem
       */
       public Usuario autenticarUsuario(Usuario usuario) throws AutenticacaoException, CifragemSenhaException{
       return rnConsultasUsuario.autenticarUsuario(usuario, rnSenhaUtil.cifrarSenha(usuario.getTxSenha() ));
       }
      
       /**
       * Retorna todas as unidade organizacionais que não possuem pai
       */
       public List<UnidadeOrganizacional> getAllUnidadesOrganizacionaisRaiz(){
       return listarUnidadesOrganizacionaisAtivas.getUnidadesOrganizacionaisRaiz();
       }
      
       /**
       * Retorna todas as unidade organizacionais ativas
       */
       public List<UnidadeOrganizacional> getAllUnidadesOrganizacionais(){
       return listarUnidadesOrganizacionaisAtivas.getUnidadesOrganizacionaisAtivas();
       }
      }
      


      and my "Query"
      package br.fpf.seguranca.businessrule.impl;
      
      import java.util.List;
      
      import javax.persistence.EntityManager;
      import javax.persistence.EntityNotFoundException;
      import javax.persistence.Query;
      
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.TransactionPropagationType;
      import org.jboss.seam.annotations.Transactional;
      
      import br.fpf.jdoctor.entitybean.seguranca.Usuario;
      import br.fpf.seguranca.businessrule.impl.exceptions.AutenticacaoException;
      
      /**
       * Classe que implementa algoritmo para geração de uma nova senha
       * @author croberto
       *
       */
      @Name("rnConsultasUsuario")
      public class RNConsultasUsuario {
      
       @In(create=true, value="#{entityManager}")
       private EntityManager em;
      
      
       public Usuario obterUsuarioPorLogin(String login) {
       Usuario usuario = null;
       // localiza o usuário
       String sql = "select usuario from Usuario usuario where usuario.txLogin = '" + login + "'";
       Query q = em.createQuery(sql);
       List result = q.getResultList();
      
       if (result.size() > 0) {
       usuario = (Usuario) result.get(0);
       }
       return usuario;
       }
      
       public Usuario obterUsuarioPorLogin(Usuario usuario) {
       // localiza o usuário
       String sql = "select usuario from Usuario usuario where usuario.txLogin = '" + usuario.getTxLogin() + "'";
       return (Usuario)em.createQuery(sql).getSingleResult();
       }
      
       public Usuario autenticarUsuario(Usuario usuario, String senhaCifrada) throws AutenticacaoException{
       String sql = " select usuario " +
       " from Usuario usuario " +
       " where usuario.txLogin = '" + usuario.getTxLogin() + "' " +
       " and usuario.txSenha = '" + senhaCifrada.trim() + "'";
      
      
       return (Usuario)em.createQuery(sql).getSingleResult();
       }
      
      }
      
      
      


      my Log
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] HQL: select usuario from br.fpf.jdoctor.entitybean.seguranca.Usuario usuario where usuario.txLogin = 'dcoronel'
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] SQL: select usuario0_.id_usuario as id1_28_, usuario0_.tx_email as tx2_28_, usuario0_.nb_tipo_usuario as nb7_28_, usuario0_.id_usuario_aprovador as id8_28_, usuario0_.tx_nome as tx3_28_, usuario0_.tx_login as tx4_28_, usuario0_.tx_senha as tx5_28_, usuario0_.cs_status as cs6_28_ from seguranca.usuario usuario0_ where usuario0_.tx_login='dcoronel'
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
      2007-12-26 19:36:48,538 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-12-26 19:36:48,553 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2007-12-26 19:36:48,553 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2007-12-26 19:36:48,553 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2007-12-26 19:36:48,553 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
      org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a000121:12dd:4772e4dd:57 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a000121:12dd:4772e4dd:57 status: ActionStatus.ABORT_ONLY >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
       at org.hibernate.loader.Loader.doQuery(Loader.java:673)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
       at org.hibernate.loader.Loader.doList(Loader.java:2220)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
       at org.hibernate.loader.Loader.list(Loader.java:2099)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
       at br.fpf.seguranca.businessrule.impl.RNConsultasUsuario.obterUsuarioPorLogin(RNConsultasUsuario.java:45)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
       at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
       at br.fpf.seguranca.businessrule.impl.RNConsultasUsuario_$$_javassist_4.obterUsuarioPorLogin(RNConsultasUsuario_$$_javassist_4.java)
       at br.fpf.seguranca.facade.impl.SegurancaFacade.bloquearUsuario(SegurancaFacade.java:91)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at br.fpf.jdoctor.interceptor.LogInterceptor.log(LogInterceptor.java:20)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:177)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72)
       at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
       at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
       at br.fpf.seguranca.facade.impl.SegurancaFacade_$$_javassist_3.bloquearUsuario(SegurancaFacade_$$_javassist_3.java)
       at br.fpf.jdoctor.managedbean.seguranca.Authenticator.authenticate(Authenticator.java:86)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
       at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
       at br.fpf.jdoctor.managedbean.seguranca.Authenticator_$$_javassist_7.authenticate(Authenticator_$$_javassist_7.java)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
       at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
       at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
       at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:108)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
       at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
       at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
       at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
       at org.jboss.seam.security.Identity.authenticate(Identity.java:259)
       at org.jboss.seam.security.Identity.authenticate(Identity.java:248)
       at org.jboss.seam.security.Identity.login(Identity.java:205)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
       at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
       at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
       at javax.faces.component.UICommand.broadcast(UICommand.java:383)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
       at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
       at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       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 org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a000121:12dd:4772e4dd:57 status: ActionStatus.ABORT_ONLY >
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 161 more
      2007-12-26 19:36:48,553 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
      2007-12-26 19:36:48,553 ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: a000121:12dd:4772e4dd:57 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a000121:12dd:4772e4dd:57 status: ActionStatus.ABORT_ONLY >)
      2007-12-26 19:36:48,553 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] mark transaction for rollback
      2007-12-26 19:36:48,569 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2007-12-26 19:36:48,569 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
      2007-12-26 19:36:48,569 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
      2007-12-26 19:36:48,569 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
      


      this is a serious problem for me... pls, if anyone can help me ?? i dont know what should i do.

      ty, sry about english