Aplicacao dando erro no tomcat

[quote=jpmpassos]vou colocar em baixo o código de erro que aparece em meu navegador…

em especial eu sublinhei uma parte no código que da uma dica para resolver o problema… mas ainda não consegui resolver…


type Exception report

message org.hibernate.TransactionException: JDBC begin failed:

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

exception

javax.servlet.ServletException: org.hibernate.TransactionException: JDBC begin failed: 
	com.evento.filtros.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:44)

root cause

org.hibernate.TransactionException: JDBC begin failed: 
	org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:96)
	org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
	sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
	$Proxy78.beginTransaction(Unknown Source)
	com.evento.filtros.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:32)

root cause

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:The last packet successfully received from the server was 73.125.696 milliseconds ago.  The last packet sent successfully to the server was 73.125.696 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
	com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
	com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3829)
	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2449)
	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2713)
	com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5060)
	org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:91)
	org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
	sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
	$Proxy78.beginTransaction(Unknown Source)
	com.evento.filtros.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:32)

root cause

java.net.SocketException: Software caused connection abort: socket write error
	java.net.SocketOutputStream.socketWrite0(Native Method)
	java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3810)
	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2449)
	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2713)
	com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5060)
	org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:91)
	org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
	sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
	$Proxy78.beginTransaction(Unknown Source)
	com.evento.filtros.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:32)

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

em especial eu sublinhei uma parte no código que da uma dica para resolver o problema… mas ainda não consegui resolver…

The last packet successfully received from the server was 73.125.696 milliseconds ago. The last packet sent successfully to the server was 73.125.696 milliseconds ago. is longer than the server configured value of ‘wait_timeout’. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property ‘autoReconnect=true’ to avoid this problem.[/quote]

Interessante… Vou dar uma olhada. To na mesma tb : /

Aparentemente consegui resolver o meu problema…

Pelo que pude ver ele não conseguia efetuar o código this.sf.getCurrentSession().getTransaction().commit(); pois a sessão tinha espirado e não tinha fechado… ou alguma coisa assim…não sei ao certo… abaixo tem o que fiz que resolveu meu problema…

OBS: utilizo como base para minha aplicação o Livro Programação Java Para Web

Tinha este código no meu filtro ConexaoHibernateFilter

try {
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
} catch (Throwable ex) {
    try {
        if (this.sf.getCurrentSession().getTransaction().isActive()) {
            this.sf.getCurrentSession().getTransaction().rollback();
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
    throw new ServletException(ex);
}

simplesmente criei um outro trycatch que se der erro nesse código acima ele manda fechar a sessão…

então o meu código ficou assim…

try {
    try {
        this.sf.getCurrentSession().beginTransaction();
        chain.doFilter(request, response);
        this.sf.getCurrentSession().getTransaction().commit();
        this.sf.getCurrentSession().close();
    } catch (Throwable ex) {
        try {
            if (this.sf.getCurrentSession().getTransaction().isActive()) {
                this.sf.getCurrentSession().getTransaction().rollback();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
        throw new ServletException(ex);
    }
} catch (Exception e) {
    this.sf.getCurrentSession().close();
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
}

Fiz a alteração na sexta feira a tarde… e cheguei hoje no meu estagio segunda feira e ainda está funcionando graças a Deus…

Referencia:

stackoverflow.com/questions/13971460/com-mysql-jdbc-exceptions-jdbc4-mysqlnontransientconnectionexception-too-many-c

[quote=jpmpassos]Aparentemente consegui resolver o meu problema…

Pelo que pude ver ele não conseguia efetuar o código this.sf.getCurrentSession().getTransaction().commit(); pois a sessão tinha espirado e não tinha fechado… ou alguma coisa assim…não sei ao certo… abaixo tem o que fiz que resolveu meu problema…

OBS: utilizo como base para minha aplicação o Livro Programação Java Para Web

Tinha este código no meu filtro ConexaoHibernateFilter

try {
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
} catch (Throwable ex) {
    try {
        if (this.sf.getCurrentSession().getTransaction().isActive()) {
            this.sf.getCurrentSession().getTransaction().rollback();
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
    throw new ServletException(ex);
}

simplesmente criei um outro trycatch que se der erro nesse código acima ele manda fechar a sessão…

então o meu código ficou assim…

try {
    try {
        this.sf.getCurrentSession().beginTransaction();
        chain.doFilter(request, response);
        this.sf.getCurrentSession().getTransaction().commit();
        this.sf.getCurrentSession().close();
    } catch (Throwable ex) {
        try {
            if (this.sf.getCurrentSession().getTransaction().isActive()) {
                this.sf.getCurrentSession().getTransaction().rollback();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
        throw new ServletException(ex);
    }
} catch (Exception e) {
    this.sf.getCurrentSession().close();
}

Fiz a alteração na sexta feira a tarde… e cheguei hoje no meu estagio segunda feira e ainda está funcionando graças a Deus…

Referencia:

stackoverflow.com/questions/13971460/com-mysql-jdbc-exceptions-jdbc4-mysqlnontransientconnectionexception-too-many-c[/quote]

Q bom q resolveu :smiley:
Vou testar essa semana, to voltando de ferias…Qualquer coisa posto aqui

Fiz uma correção na minha ultima resposta …
adicionei os codigos

    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close(); 

após this.sf.getCurrentSession().close();

pois antes precisava atualizar duas vezes pra funcionar normalmente…
agora esta em perfeito estado…

[quote=jpmpassos]Fiz uma correção na minha ultima resposta …
adicionei os codigos

    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close(); 

após this.sf.getCurrentSession().close();

pois antes precisava atualizar duas vezes pra funcionar normalmente…
agora esta em perfeito estado…[/quote]

Tem como vc colar a sua classe ConexaoHibernateFilter aqui ? Tem alguns pequenos detalhes q parece q nao ta batendo aqui !

[]'s

E ai ? Resolveu o problema ?

[quote=tiago__][quote=jpmpassos]Fiz uma correção na minha ultima resposta …
adicionei os codigos

    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close(); 

após this.sf.getCurrentSession().close();

pois antes precisava atualizar duas vezes pra funcionar normalmente…
agora esta em perfeito estado…[/quote]

Tem como vc colar a sua classe ConexaoHibernateFilter aqui ? Tem alguns pequenos detalhes q parece q nao ta batendo aqui !
[]'s[/quote]

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evento.filtros;

import com.evento.util.HibernateUtil;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.hibernate.SessionFactory;

/**
 *
 * @author João Paulo
 */
public class ConexaoHibernateFilter implements Filter {

    private SessionFactory sf;

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        this.sf = HibernateUtil.getSessionFactory();
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        try {
            try {
                this.sf.getCurrentSession().beginTransaction();
                chain.doFilter(request, response);
                this.sf.getCurrentSession().getTransaction().commit();
                this.sf.getCurrentSession().close();
            } catch (Throwable ex) {
                try {
                    if (this.sf.getCurrentSession().getTransaction().isActive()) {
                        this.sf.getCurrentSession().getTransaction().rollback();
                    }
                } catch (Throwable t) {
                    t.printStackTrace();
                }
                throw new ServletException(ex);
            }
        } catch (Exception e) {
            this.sf.getCurrentSession().close();
            this.sf.getCurrentSession().beginTransaction();
            chain.doFilter(request, response);
            this.sf.getCurrentSession().getTransaction().commit();
            this.sf.getCurrentSession().close();
            //FacesContext.getCurrentInstance().getExternalContext().redirect("index.jsf");
        }

    }

    @Override
    public void destroy() {
    }
}

[quote=jpmpassos][quote=tiago__][quote=jpmpassos]Fiz uma correção na minha ultima resposta …
adicionei os codigos

    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close(); 

após this.sf.getCurrentSession().close();

pois antes precisava atualizar duas vezes pra funcionar normalmente…
agora esta em perfeito estado…[/quote]

Tem como vc colar a sua classe ConexaoHibernateFilter aqui ? Tem alguns pequenos detalhes q parece q nao ta batendo aqui !
[]'s[/quote]

[code]
/*

  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    */
    package com.evento.filtros;

import com.evento.util.HibernateUtil;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.hibernate.SessionFactory;

/**
*

  • @author João Paulo
    */
    public class ConexaoHibernateFilter implements Filter {

    private SessionFactory sf;

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    this.sf = HibernateUtil.getSessionFactory();
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    try {
    try {
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
    } catch (Throwable ex) {
    try {
    if (this.sf.getCurrentSession().getTransaction().isActive()) {
    this.sf.getCurrentSession().getTransaction().rollback();
    }
    } catch (Throwable t) {
    t.printStackTrace();
    }
    throw new ServletException(ex);
    }
    } catch (Exception e) {
    this.sf.getCurrentSession().close();
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
    //FacesContext.getCurrentInstance().getExternalContext().redirect(“index.jsf”);
    }

    }

    @Override
    public void destroy() {
    }
    }

[/code][/quote]

Vou deixar minha classe = a sua, vamos ver se vai dar certo !

Vc ta usando o autoReconnect=true na classe hibernate.cfg.xml ? Nessa linha aqui:

<property name="connection.url">jdbc:mysql://javaserver:3306/requmaterial?autoReconnect=true</property>

[quote=tiago__][quote=jpmpassos][quote=tiago__][quote=jpmpassos]Fiz uma correção na minha ultima resposta …
adicionei os codigos

    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close(); 

após this.sf.getCurrentSession().close();

pois antes precisava atualizar duas vezes pra funcionar normalmente…
agora esta em perfeito estado…[/quote]

Tem como vc colar a sua classe ConexaoHibernateFilter aqui ? Tem alguns pequenos detalhes q parece q nao ta batendo aqui !
[]'s[/quote]

Minhas configurações do hibernate.cfg.xml


        <property name="current_session_context_class">thread</property>
        <property name="connection.relaxAutoCommit">true</property>  
        <property name="connection.autoReconnect">true</property>
        <property name="hibernate.connection.autocommit">true</property>
        <property name="hibernate.connection.release_mode">on_close</property>
        
    
        <!-- Usando as configurações do C3PO para pool de conexões -->
        <property name="c3po.min_size">5</property>
        <property name="c3po.max_size">20</property>
        <property name="c3po.timeout">300</property>
        <property name="c3po.max_statements">50</property>
        <property name="c3po.idle_test_period">3000</property>
        
        
        <!-- Configurações de debug -->
        <property name="show_sql">true</property>
        <property name="format_sql">true</property>
        <property name="generate_statistics">true</property>
        <property name="use_sql_comments">true</property>
        <!-- Mapeando classes -->

[code]
/*

  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    */
    package com.evento.filtros;

import com.evento.util.HibernateUtil;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.hibernate.SessionFactory;

/**
*

  • @author João Paulo
    */
    public class ConexaoHibernateFilter implements Filter {

    private SessionFactory sf;

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    this.sf = HibernateUtil.getSessionFactory();
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    try {
    try {
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
    } catch (Throwable ex) {
    try {
    if (this.sf.getCurrentSession().getTransaction().isActive()) {
    this.sf.getCurrentSession().getTransaction().rollback();
    }
    } catch (Throwable t) {
    t.printStackTrace();
    }
    throw new ServletException(ex);
    }
    } catch (Exception e) {
    this.sf.getCurrentSession().close();
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
    //FacesContext.getCurrentInstance().getExternalContext().redirect(“index.jsf”);
    }

    }

    @Override
    public void destroy() {
    }
    }

[/code][/quote]

Vou deixar minha classe = a sua, vamos ver se vai dar certo !

Vc ta usando o autoReconnect=true na classe hibernate.cfg.xml ? Nessa linha aqui:

<property name="connection.url">jdbc:mysql://javaserver:3306/requmaterial?autoReconnect=true</property> [/quote]

Entao, deixei a classe ConexaoHibernateFilter = a sua e o erro continua.

Fui no log do tomcat onde app ta rodando e achei isso aqui :

Jul 09, 2013 7:33:18 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-80
Jul 09, 2013 7:33:19 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 09, 2013 7:33:19 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/rm] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jul 09, 2013 7:33:19 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/rm] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
Jul 09, 2013 7:33:19 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/rm] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
Jul 09, 2013 7:33:19 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/rm] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@21e0926d]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Jul 09, 2013 7:33:20 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-80
Jul 09, 2013 7:33:26 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;;.
Jul 09, 2013 7:33:26 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Jul 09, 2013 7:33:26 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 449 ms
Jul 09, 2013 7:33:26 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 09, 2013 7:33:26 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Jul 09, 2013 7:33:26 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jul 09, 2013 7:33:27 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor rm.xml
Jul 09, 2013 7:33:27 AM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener “com.sun.faces.config.ConfigureListener” is already configured for this context. The duplicate definition has been ignored.

[b]
ps:

O tomcat q ta instaldo no server q a app ta rodando eh versao 6. O server q ta insataldo na maquina q eu fiz
a app (localhost) eh a versao 7. Sera q eh por causa disso ? Vou deixar a classe ConexaoHibernateFilter como
estava antes ( =ao livro) pois nao tive sucesso com as modificacoes. Vou colocar o uma parte do log do tomcat aqui.
[/b]

Sobre meu Toncat
Em minha aplicação utilizo toncat mais atual, e sempre quando sai um novo eu passo a utiliza-lo…

Sobre o Erro
Se vc perceber o erro já mudou… pode ser q o problema anterior foi resolvido… porque as alterações na classe ConexaoHibernateFilter que fiz não causa erro pois simplesmente quando ele da um erro geral, como antes tava dando no JDBC commit failed ela entra na exceção, que fecha a sessão que não teve como fechar pois parou na linha do commit e tenta tudo novamente…

não vejo as alterações da minha classe podem casar esse erro…

try {
    try {
        this.sf.getCurrentSession().beginTransaction();
        chain.doFilter(request, response);
        this.sf.getCurrentSession().getTransaction().commit();
        this.sf.getCurrentSession().close();
    } catch (Throwable ex) {
        try {
            if (this.sf.getCurrentSession().getTransaction().isActive()) {
                this.sf.getCurrentSession().getTransaction().rollback();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
        throw new ServletException(ex);
    }
} catch (Exception e) {
    this.sf.getCurrentSession().close();
    this.sf.getCurrentSession().beginTransaction();
    chain.doFilter(request, response);
    this.sf.getCurrentSession().getTransaction().commit();
    this.sf.getCurrentSession().close();
}

uma observação: em minha aplicação não utilizo esta classe HibernateRestoreViewPhaseListener e nem essa HibernateRenderResponsePhaseListener…