0

I am trying to test a web-based application. The webserver I am using is wildfly and API for database access is JDBC.

The problem is that I am trying to automate tests using selenium webdriver. At first I run the server and using a separate Eclipse project I run my selenium tests.

In the tests a browser is opened a link is accessed and then login is done and then some searches of the database through the software... etc. It is obvious that during the span of the tests the DB is called upon several times.

In the first few runs of the tests everything works just fine but then suddenly I start getting the errors:

16:01:31,580 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-36) SQL Error: 0, SQLState: null
16:01:31,581 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-36) javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/OracleDS
16:01:31,585 ERROR [org.jboss.as.ejb3] (default task-36) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
16:01:31,586 ERROR [org.jboss.as.ejb3.invocation] (default task-36) JBAS014134: EJB Invocation failed on component FidaRoleConfigurationDao for method public java.util.List ag.rul.safex.fida.authentication.dataaccess.FidaRoleConfigurationDao.findAllByExternalRoles(java.util.Set): javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Could not open connection
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:163) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:253) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:342) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

I assume it has something to do with connections that my program creates with the DB. It can be the connections are created too fast that somehow breaks the system or maybe too many connections are made and due to connection leakage somewhere this problem happens.

PS: I talked to another developer and he said that sometimes he also gets the same issues even when he is working on the software normally (i.e. not doing automated fast testing). Then he just re-launches the server to fix the problem.

Please let me know what other information is required. Pom.xml or Persistence or something else. It is a very persistent problem that I would really appreciate help with.

Thanks in advance.

ITguy
  • 847
  • 2
  • 10
  • 25
  • Then you either have a connection pool leak or it is configured with not enough connetions or the database itself limits the number of connetions. – Kukeltje Nov 13 '17 at 16:05
  • @Kukeltje how can I find out? How should I approach this problem? – ITguy Nov 13 '17 at 16:13
  • The approach should be to use Google or Bing or any other serious searchengine (just searching in stackoverflow might help to). (and connetions should of course be connections) – Kukeltje Nov 13 '17 at 16:16
  • Thank you @Kukeltje for your advice. As you might be able to see I am doing just that. What I expected from this answer was something specific like see file xyz configuration that is where the problem might lie or something along those lines. – ITguy Nov 13 '17 at 16:18
  • All that can be found using google now you know what to check (connection pool size etc). There are so many ways to configure that, that it is undoable for me (or others) to start summarizing that. (and I don't use Oracle, so I would not even know) – Kukeltje Nov 13 '17 at 16:24

0 Answers0