Please login or register to access secure site features.

Note: By continuing to use DevConnect Program Services you agree to our latest Registered Member Terms.

Sign in using DevConnect ID

Forgot password?

Trouble logging in?

Submit a ticket for Registration Support.

I have an SSO ID

?
sign in

Don't have a DevConnect or SSO ID ?

Create a DevConnect account or join the program.

register now
^
Forum Index » Avaya Orchestration Designer » AOD V8 connection pool error for DB2 connection   XML
 
Author Message
BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

I have upgraded my application from V6 to AOD V8 with a DB2 connection. I am getting the following error when first trying to access the database:

java.sql.SQLException | ddLastException:message : RegisterPool failed.

After upgrading my app and fixing variables, etc, I have done the following:
- From Eclipse: Window->Preferences->Avaya->Orchestration Designer->Database Add jt400-10.5.jar
- add jar to project WEB-INF/libs
- add jar to project properties Libraries Classpath
- Refreshed, cleaned, saved, rebuilt and exported project
- add jt400-10.5.jar to tomcat/baseLib folder
- deployed project to app server (tomcat9 - old system with AOOD V6 was tomcat6)

App comes up fine and plays the greeting and does all proper inititalization. First DB connect query attempt returns above error.

Need help on how to fix this issue.


WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3720
Offline

Can you show me the <appname>.xml context file in the Tomcat's config/catalina/localhost directory? It seems some information is missing there.
BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

Here is the contents of the xml file you asked for:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Context docBase="./AppName" path="/AppName" reloadable="true">

<Resource auth="Container" driver="com.ibm.as400.access.AS400JDBCDriver" factory="org.apache.tomcat.dbcp.dbcp2.cpdsadapter.DriverAdapterCPDS" name="jdbc/CVDB_TESTCPDS" type="org.apache.tomcat.dbcp.dbcp2.cpdsadapter.DriverAdapterCPDS" url="jdbc:as400://12.345.679.90:8471?connectTimeout=15000&amp;socketTimeout=15000&amp;naming=system;errors=full;prompt=false;"/>
<Resource auth="Container" dataSourceName="java:/comp/env/jdbc/CVDB_TESTCPDS" defaultMaxActive="50" defaultMaxIdle="50" defaultMaxWait="20000" factory="org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSourceFactory" logAbandoned="true" name="jdbc/CVDB_TEST" removeAbandoned="true" removeAbandonedTimeout="60" testOnBorrow="true" type="org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource" validationQuery="VALUES 1" validationInterval="3000" timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer" />
</Context>
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3720
Offline

This file actually looks fine. I have question about add the jar to the Tomcat lib folder. Typically, the jar goes into Tomcat Home/lib. I am sure about this baseLib folder in your post.

add jt400-10.5.jar to tomcat/baseLib folder
BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

Yes, we put the jar file into the tomcathome/baseLib folder
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3720
Offline

I mistyped. The baseLib folder is not familiar to me for Tomcat. Are you sure it is the same as the lib folder?
BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

off of tomcatHome (/opt/tomcatApps/ivr_appserver6/) we have baseLib folder. We also have sharedLib and lib and conf folders.
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3720
Offline

In the context xml file, is this your application name - AppName? The name and path don't make sense. This problem definitely has to do with Tomcat not able to locate the datasource definition in this file.

<Context docBase="./AppName" path="/AppName" reloadable="true">
BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

I have the correct AppName there. I just changed it for security purposes. Using javax* data source directly calls the BasicDataSource method that throws error it does not support DB connection pools. In researching the error, the issue is just that the connection string in the AOD code needs to directly provide username and password.Using the AOD data source tab, I added the username and password to the connection url; however, the problem still persists. Here is how I changed the connection url:
jdbc:as400://10.110.110.10:8471?connectTimeout=15000&socketTimeout=15000&naming=system;errors=full;prompt=false;user=DBUSER;password=DBPassword
When I test the connection from the Edit Data Source tab, it is successful.
I believe the actual connection code is part of the AOD's tool's and cannot be edited to change the connection parameters?
Here is the error I am getting after deployment and making a call to the application:
***** Saw exception, tracing before report
javax.servlet.ServletException: EXCEPTION>
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1562)
at com.avaya.sce.runtime.jdbc.Database.open(Database.java:93)
at com.avaya.sce.runtime.connectivity.db.DbQuery.executeSQL(DbQuery.java:196)
at com.avaya.sce.runtime.connectivity.db.DbQuery.execute(DbQuery.java:134)
at com.avaya.sce.runtime.Data.evaluateActions(Data.java:228)
at flow.subflow.BuildSP1Query.DB_SPVRU701.executeDataActions(DB_SPVRU701.java:85)
at com.avaya.sce.runtime.Data.handleRequest(Data.java:121)
at com.avaya.sce.runtime.AppServlet.processRequest(AppServlet.java:96)
at com.avaya.sce.runtime.SCEServlet.requestHandler(SCEServlet.java:247)
at com.avaya.sce.runtime.SCEServlet.doGet(SCEServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

Is there a workaround to force the AOD generated code to fix this issue?

This message was edited 1 time. Last update was at 15/03/2021 16:37:05

BarbaraMcCord



Joined: 01/12/2020 20:23:01
Messages: 6
Offline

The tomcat9 jdbc connection pool setup is different. https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html shows how the JDBC Connection Pool org.apache.tomcat.jdbc.pool is a replacement or an alternative to the Apache Commons DBCP connection pool.
How does avaya AOD create the connection pool within the application? How do we remedy it setting up CPDS automatically when it creates the war file?

This message was edited 1 time. Last update was at 15/03/2021 21:05:27

WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3720
Offline

This is not the problem here. Tomcat 9 does provide a different jar file for the connection pooling. It maybe just the same implementation inside. However, the configuration does not change. Although I don't have an db2 database to test, I am able to use the driver file and the same datasource configuration generated by OD. I can get to the point where the code is trying to connect to the database. I don't get the pool failure you have are seeing. We do the same thing for all other databases which we can test.
 
 
Go to: