cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
783
Views
5
Helpful
4
Replies

Database Connection

Akib Dargawale
Level 1
Level 1

Hello, I'm trying to connect the database using the database element.

Application Ran Successfully when I Debug, but when I tried to run using vxml server I got an error.

Context file-

<!-- The contents of this file will be loaded for each web application -->
<Context>

<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/MOMIVRDB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://192.168.1.31:1433;integratedSecurity=true; user=AKIBLAB\Administrator; password=; DatabaseName=MOMIVRDB"
/>
<Manager pathname="" />

</Context>

 

Error-

Caused by: com.audium.server.AudiumException: Cannot create PoolableConnectionFactory (Cannot open database "MOMIVRDB" requested by the login. The login failed. ClientConnectionId:f5940803-3aad-488a-974a-0e41aff47c04)
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: java.sql.SQLException: Cannot create PoolableConnectionFactory (Cannot open database "MOMIVRDB" requested by the login. The login failed. ClientConnectionId:f5940803-3aad-488a-974a-0e41aff47c04)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2342)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2067)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543)
at com.audium.server.action.database.DatabaseAction.doAction(DatabaseAction.java:313)
... 28 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "MOMIVRDB" requested by the login. The login failed. ClientConnectionId:f5940803-3aad-488a-974a-0e41aff47c04
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:256)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:108)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$1LogonProcessor.complete(SQLServerConnection.java:4269)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:4547)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3406)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:85)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3370)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7347)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2713)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2261)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1921)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1762)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1077)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:618)
at org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:262)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2352)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2338)
... 31 more

 

Please Help me.

 

4 Replies 4

janinegraves
Spotlight
Spotlight

I tried googling this: java.sql.SQLException: Cannot create PoolableConnectionFactory 

And got this: "https://stackoverflow.com › questions › cannot-create-p...
Jan 4, 2013 — This is a network problem. Check out your database connectivity. Either your database connection link, username and password is wrong or your ..."

 

I assume it's a firewall issue. I also see a blank space in your url string, so be sure to remove that.
If you're using 11.6 or 12.0, I believe there was a registry fix required to allow TLS1.2, check cisco.com
Be sure you have added the right jdbc driver in VXMLserver/tomcat/lib - it's java version and DB version specific.

 

 

Hello Mam,

Thanks for your Reply.

I have updated the Context file as you Suggested.

I have used the 12.0 version of cisco, and the SQL is SQLJDBC41.jar.

The username and IP address are correct.

The firewall is disabled.

Context file-

<Resource name="jdbc/MOMIVRDB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://192.168.1.31:1433;integratedSecurity=true;user=AKIBLAB\Administrator;DatabaseName=MOMIVRDB"

/>

 

But When I Debug the application Got the Answer-

Connecting...
Prompt: (http://192.168.1.31/en-us/app/RechargeOf.wav) two (http://192.168.1.31/en-us/sys/2.wav) hundred (http://192.168.1.31/en-us/sys/hundred.wav) forty (http://192.168.1.31/en-us/sys/40.wav) nine (http://192.168.1.31/en-us/sys/9.wav)
Disconnected.

 

I don't understand why the vxml server shows an error.

Please Help.

 

Hello mam,

When i add this line to the Context file-

factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

Context file-

<Resource name="jdbc/MOMIVRDB"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://192.168.1.31:1433;integratedSecurity=true;user=AKIBLAB\Administrator;DatabaseName=MOMIVRDB"
/>

Got Different Error-

 

192.168.1.31.1639983547797.0.DbDemo,12/20/2021 12:29:09.047, The error was: A built-in element encountered an exception of type com.audium.server.AudiumException. There was a problem looking up the JNDI data source 'MOMIVRDB'. The root cause was: javax.naming.NameNotFoundException: Name [MOMIVRDB] is not bound in this Context. Unable to find [MOMIVRDB].
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: There was a problem looking up the JNDI data source 'MOMIVRDB'.
at com.audium.server.action.database.DatabaseAction.getDataSourceForTomcat(DatabaseAction.java:237)
at com.audium.server.action.database.DatabaseAction.getDataSource(DatabaseAction.java:192)
at com.audium.server.action.database.DatabaseAction.doAction(DatabaseAction.java:305)
at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:390)
... 27 more
Caused by: javax.naming.NameNotFoundException: Name [MOMIVRDB] is not bound in this Context. Unable to find [MOMIVRDB].
at org.apache.naming.NamingContext.lookup(NamingContext.java:817)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:163)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.audium.server.action.database.DatabaseAction.getDataSourceForTomcat(DatabaseAction.java:235)
... 30 more

 

1. I believe that Studio11.6 and perhaps 12.0, the Debugger used a
different version of java than VxmlServer. So that might explain why you
can connect to the DB from the Debugger, but not from VxmlServer.

On your VxmlServer, change into C:\Cisco\CVP\jre\bin and execute "java
-version"    If you're using java 8, then you must use a different JDBC
jar file (not 41.jar)

2. JAR File:
A) Through CVP11.5, use sqljdbc4.jar

B) CVP 11.6 and SQL2014SP2 db, use sqljdbc41.jar or
mssql-jdbc-6.4.0.jre7.jar
MODIFY THE CVP REGISTRY:    HKEY_LOCAL_MACHINE -> SOFTWARE ->
Wow6432Node -> Apache Software Foundation -> Procrun 2.0 -> VXMLServer
-> Parameters -> Java -> Options. Add -Djdk.tls.client.protocols=TLSv1.2

C)  **** I don't know what to use for 12.0, I believe it depends what
version of java you have running
and which version sql server you're connecting to

D) CVP12.5 (java use mssql-jdbc-8.2.2.jre8.jar


3. Do NOT use this in the context.xml as it causes VxmlServer not to
reconnect to the DB if the DB goes down and then comes back up.
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

4. I've never seen ;integratedSecurity=true;  in the URL string with
VXMLServer - can you remove that and retry.

5******. Be sure you restart VXMLServer after any changes.