aspose file tools*
The moose likes Other Application Frameworks and the fly likes Spring-Struts Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring-Struts Issue" Watch "Spring-Struts Issue" New topic
Author

Spring-Struts Issue

Bjorn Stove
Greenhorn

Joined: Jan 08, 2005
Posts: 19
Hi ranchers!
Im having a datasource problem when using Spring with Struts.
When I use my web application it works fine the first time
I log in and the db connection works fine.

When I open a second browser and log in the datasource connection
times out.

Using Struts 1.3 JBoss 4.0.4 Spring 2.5

I use spring plug-in in my strut-config.xml:




I have a 'StartAction' that init the database:
code snippet:


So this works fine first time. But second time request from another browser
generats error like stated below.

Maybe I missunderstand something about Spring how it handles hibernate Sessions?



Thanfull for any help.

Error log:

11:06:44,112 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:06:44,112 ERROR [JDBCExceptionReporter] No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
11:06:44,112 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:06:44,112 ERROR [JDBCExceptionReporter] No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
11:06:44,174 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
11:06:44,206 INFO [SQLErrorCodesFactory] SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
11:07:14,237 WARN [SQLErrorCodesFactory] Error while extracting database product name - falling back to empty error codes
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:198)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:225)
at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:216)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:147)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:110)
at org.springframework.orm.hibernate3.SessionFactoryUtils.newJdbcExceptionTranslator(SessionFactoryUtils.java:143)
at org.springframework.orm.hibernate3.HibernateAccessor.getDefaultJdbcExceptionTranslator(HibernateAccessor.java:453)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:378)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
at com.bmsystem.hibernate.ObjectsUsersDao.findObjectsByUserName(ObjectsUsersDao.java:43)
at com.bmsystem.palaceweb.delegate.ObjectUsersORMDelegate.findObjectsByUserName(ObjectUsersORMDelegate.java:39)
at com.bmsystem.palaceweb.logic.impl.PalaceWebDatabaseHandlerImpl.findObjectsByUserName(PalaceWebDatabaseHandlerImpl.java:70)
at com.bmsystem.palaceweb.logic.impl.RatSelectionContainerImpl.refreshRatList(RatSelectionContainerImpl.java:83)
at com.bmsystem.palaceweb.actions.StartAction.execute(StartAction.java:66)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.bmsystem.palaceweb.util.RequestFilter.doFilter(RequestFilter.java:65)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:185)



Best Regards
Bjorn
Steven Besher
Greenhorn

Joined: Apr 09, 2009
Posts: 1
Hi,
I have a very similar issue with Spring beans generated within a Jboss AS container. The first connection is retrieved successfully but succeeding connection attempts timeout.

Did you get any response to your original post?
 
 
subject: Spring-Struts Issue