06-10-2024 12:25 AM
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.
06-10-2024 04:20 AM
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?
06-11-2024 11:34 PM - edited 06-11-2024 11:36 PM
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.
06-12-2024 06:39 AM
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.
07-04-2024 12:52 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide