These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Connecton closed exception - first attemps of connecting
PostPosted: Mon Oct 17, 2011 6:07 am 
Newbie

Joined: Mon Aug 04, 2008 2:21 am
Posts: 2
Dear all,

Hope you guys can help me with the following problem. I've created an web application which runs on JBoss. Everytime when I open this application, the first two or three times the application connects to the database fail. The times after, the connections work perfectly. This occurs every time after some time of inactivity in the application.

I think it has something to do with the connection pooling of JBoss its Hibernate settings (connection-pooling) however I'm not sure. As front-end technique i'm using GWT and the database is running on DB2.

Find below the stacktrace:
Code:
2011-10-14 12:22:31,762 - Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.Void *.*.*.client.service.SaveSettingsService.saveSettings(*.*.pdf.*.Settings)' threw an unexpected exception: org.hibernate.exception.JDBCConnectionException: Cannot open connection
          at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
          at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
          at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
          at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
          at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          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:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
          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:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.exception.JDBCConnectionException: Cannot open connection
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
          at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
          at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
          at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
          at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1354)
          at sun.reflect.GeneratedMethodAccessor1397.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
          at $Proxy577.beginTransaction(Unknown Source)
          at *.*.*.data.EfDao.saveUserSettings(EfDao.java:725)
          at *.*.*.server.SettingServiceImpl.saveSettings(SettingServiceImpl.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 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
          ... 25 more
Caused by: com.ibm.db2.jcc.am.SqlNonTransientConnectionException: [jcc][t4][10335][10366][4.11.69] Invalid operation: Connection is closed. ERRORCODE=-4470, SQLSTATE=08003
          at com.ibm.db2.jcc.am.gd.a(gd.java:666)
          at com.ibm.db2.jcc.am.gd.a(gd.java:60)
          at com.ibm.db2.jcc.am.gd.a(gd.java:120)
          at com.ibm.db2.jcc.am.lb.ec(lb.java:5331)
          at com.ibm.db2.jcc.am.lb.getAutoCommit(lb.java:976)
          at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:127)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
         ... 41 more


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.