aspose file tools*
The moose likes Object Relational Mapping and the fly likes  Data source rejected establishment of connection,  message from server: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " Data source rejected establishment of connection,  message from server: "Too many connections"" Watch " Data source rejected establishment of connection,  message from server: "Too many connections"" New topic
Author

Data source rejected establishment of connection, message from server: "Too many connections"

Vikas K Agrawal
Greenhorn

Joined: Dec 18, 2011
Posts: 4
Hello All,

we have a web service which is implemented using Restful framework and Hibernate. To measure the performance of web service I am using junit perf 1.9. When i create more the 100 concurrent user using Junit perf this service is throwing exception. the stack trace of exception is as below:

.log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).

log4j:WARN Please initialize the log4j system properly.

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 23 more

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 22 more

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 22 more

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 23 more

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 22 more

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

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:1353)

at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)

at $Proxy22.beginTransaction(Unknown Source)

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:184)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

... 22 more

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source)

org.siemens.snp.execption.CTException: <error>Unknown Error</error>

at org.siemens.snp.services.ForumService.getAllCommentsForTopic(ForumService.java:267)

at test.org.junit.testcases.ForumServiceTest.testGetAllCommentsForTopic(ForumServiceTest.java:61)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at com.clarkware.junitperf.ThreadedTest$TestRunner.run(ThreadedTest.java:75)

at java.lang.Thread.run(Unknown Source).


your suggestions would be high appreciated.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3825

Looks like it exceeds the maximum connections allowed. How many connections you have configured to use, and what connection pool (or any other) mechanism used?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vikas K Agrawal
Greenhorn

Joined: Dec 18, 2011
Posts: 4
Hi Vijitha,

thanks for reply. I was not using any connection pooling and after some googling i found one solution over here which solved my problem.
http://www.databasesandlife.com/automatic-reconnect-from-hibernate-to-mysql/

Now i have implemented connection pooling using c3p0 as suggested in above blog which solved my problem.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data source rejected establishment of connection, message from server: "Too many connections"