私は休止状態でjsf 2.0を使用しています..私のアプリケーションは夕方に終了するとうまく動作しますが、毎朝この例外が発生し、動作させるためにアプリケーションを再起動する必要がありました.
これを引き起こす原因
org.hibernate.exception.JDBCConnectionException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2231)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
chennaivolunteer.common.ViewActivityBean.getFirstngo(ViewActivityBean.java:156)
sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:85)
org.apache.myfaces.view.facelets.component.UIRepeat.getValue(UIRepeat.java:246)
org.apache.myfaces.view.facelets.component.UIRepeat.getDataModel(UIRepeat.java:209)
org.apache.myfaces.view.facelets.component.UIRepeat._validateAttributes(UIRepeat.java:528)
org.apache.myfaces.view.facelets.component.UIRepeat.process(UIRepeat.java:578)
org.apache.myfaces.view.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1137)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:609)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1159)
org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
root cause
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed
after connection closed.Connection was implicitly closed due to underlying exception/error:
これが私のhibernate.cfg.xmlです
<hibernate-configuration>
<session-factory name="">
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://192.168.1.200:3306
/chennai_volunteers</property>
<!-- <property name="connection.url">jdbc:mysql://localhost:330
/chennai_volunteers</property> -->
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.connection.pool_size">100</property>
<!-- start c3p0 connection properties -->
<property name="c3p0.min_size">20</property>
<property name="c3p0.max_size">500</property>
<property name="c3p0.timeout">25200</property>
<property name="c3p0.acquireRetryAttempts">30</property>
<property name="c3p0.acquireIncrement">5</property>
<property name="c3p0.idleConnectionTestPeriod">14400</property>
<property name="c3p0.initialPoolSize">20</property>
<property name="c3p0.maxPoolSize">300</property>
<property name="c3p0.maxIdleTime">300</property>
<property name="c3p0.maxStatements">200</property>
<property name="c3p0.minPoolSize">10</property>
</session-factory>
</hibernate-configuration>
前もって感謝します。