cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
358
Views
2
Helpful
4
Replies

Call Studio - Database Element - Connection Closed to the Database

ln33147
Level 4
Level 4

Hello,

This regarding a CVP environment version 12.0
We have a Call Studio script that includes a database element.
Sometimes, the connection to the database is getting closed (from CVP to the database created under AW) as per the below error. Please find attached Tomcat logs and the issue gets solved after restarting CVP server. To note that both CVP and AW services are up and running.

The error was: A built-in element encountered an exception of type com.audium.server.AudiumException. The connection is closed. The root cause was: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.

com.audium.server.AudiumException: A built-in element encountered an exception of type com.audium.server.AudiumException.
                at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:416)
                at com.audium.server.controller.Controller.goToAction(Controller.java:4446)
                at com.audium.server.controller.Controller.goToElement(Controller.java:4082)
                at com.audium.server.controller.Controller.continueCall(Controller.java:3762)
                at com.audium.server.controller.Controller.doPost(Controller.java:1175)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
                at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)
                at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:748)
Caused by: com.audium.server.AudiumException: The connection is closed.
                at com.audium.server.action.database.DatabaseAction.doAction(DatabaseAction.java:367)
                at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:390)
                ... 27 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:390)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.setAutoCommit(SQLServerConnection.java:1885)
                at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
                at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
                at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:79)
                at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
                at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
                at com.sun.proxy.$Proxy55.setAutoCommit(Unknown Source)
                at com.audium.server.action.database.DatabaseAction.doAction(DatabaseAction.java:359)

Has anyone faced a similar issue and can advise?

thanks in advance.

4 Replies 4

janinegraves
Spotlight
Spotlight

Please post the VXMLServer/Tomcat/conf/context.xml file.
If the context.xml file contains the attribute factory="..." then that's the problem, you should remove that attribute and restart VXMLServer.

What JDBC driver are you using in VXMLServer/Tomcat/lib?

 

ln33147
Level 4
Level 4

Hello Janine,

Thank you for your input.

Please find below the context.xml file and note that removing the factory line causes an issue and the connection cannot be established.

<!-- The contents of this file will be loaded for each web application -->
<Context>
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Manager pathname="" />
<Resource name="jdbc/IVRCALLCENTER"
          factory="nl.wimvanhaaren.tomcat.secured.EncryptedDataSourceFactory"
          auth="Container"
          type="javax.sql.DataSource"
          maxActive="100"
          maxIdle="30"
          maxWait="10000"
          username="IVRUser"
          password="2620756699e3b5358a92b07bb81939d6"
          driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
          url="jdbc:sqlserver://ServerIP:1433;databaseName=DBName"/>
</Context>
Regarding the jdbc driver, tomcat-jdbc.jar is the one under VXML/Tomcat/lib

janinegraves
Spotlight
Spotlight

In your original post, you state that 'sometimes the connection to the database is getting closed' ...leading to the error. So does that mean that the Database element works just fine some of the time?

If so, I recommend you catch the java event *.* and try executing the DB element one more time (don't allow an infinite loop). As it may work the 2nd time you try it. That was the old workaround for such an issue as what you're seeing.

Do you know how to do this?

1.You use the Database element's Events tab press [Add] to add an event handler (this creates a new exit state) called NewEvent1

1a.In the events tab, at the top, select the NewEvent1. At the bottom of that tab, configure Name: JavaExc and EventList: *.*  (star dot star to catch all java events)

1b. Now in the workspace, connect this new exit state JavaExc to a Decision element.

1c. Click: Use DecisionEditor - and select the IF statement in the Expression box.

1d.  At the bottom of the DecisionEditor, configure it to check:  if Caller Activity > Number of Times an Element has been visited > Element: Decision01 (or whatever the name of this current Decision element is)   Operation:  < (less than)   2ndArg: Constant Number 2

Then go to the upper right corner of that box (column named return) and enter: retry

Halfway down in that window, where it says Otherwise, enter:  maxtries

Press OK to exit the Decision Editor

1e. Now connect the Decision01 element exit state named retry back to your Database element
 And connect exit state: maxtries to tell the caller there's a problem and then return the caller to ICM.

If this works, let me know because then you need to connect  the Database-JavaExc to an element that logs need to also log the {Data.Session.lastException.exception} to the Activity Log before executing the Decision01 element. Because catching events suppresses the error log from displaying the cause of the error. 

 

Hello Jeanine,

The issue was solved after following your suggestion. Please advise on the procedure to log the {Data.Session.lastException.exception} to the activity log.

Aside, is it feasible that we add two connections under the context file, a connection that points to side A and another connection that points to side B?

Thanks so much for your support.