Author Message
MaragathamAnjali
Joined: Oct 9, 2015
Messages: 12
Offline
Hi,

I had referred the below thread.I have similar kind of issue.

https://www.devconnectprogram.com/forums/posts/list/9146.page

Followed below Steps:
1.I have configured my Database Details in OD pluggable connectors.
2.I have added the driver jar sqljdbc4.jar in Windows-->Preferences-->Avaya Aura --> Orchestration designer -->DataBase
3.Updated the context(Right Click on project --> Orchestration Designer --> Update Context)
4.Placed the exported war into tomcat/webapps
5.Cleaned work folder and *.xml file in Tomcat/conf/catalina/localhost directory.
6.Started the tomcat

Below are the observations.
1.context.xml file under META-INF is updated with database details.
2.<appname>.xml file is not generated under Tomcat/conf/catalina/localhost directory.
3.Validated the apllication through jsp validate.jsp and got the exception.(DB_validate_error.jpg)
4.Got below exception in trace.log.
17/06/2016 14:43:10:658 INFO - DBC5F72B5837D70CFF6C7304C6C1212D:/ConnEst_IVR : Capturing exception [javax.servlet.ServletException]. Message [ EXCEPTION>
javax.naming.NameNotFoundException: Name [jdbc/ConnEstSqlserver] is not bound in this Context. Unable to find [jdbc].

Temp Solution made to resolve this issue:
1.Copied the context.xml file under <appname>/META-INF/context.xml from production Sever(Where it is working fine with prod ip)
2.Replaced the context.xml file in Lab Server and updated the Lab Ip address in the file.

Now the connection established successfully.

Environment Details.:
Lab:
AAOD version 6.0.11.03
Tomcat version: 7.0.69
JDK Version: 1.7.0_25

Prod:
AAOD version 6.0.11.03
Tomcat version: 6.x.x
JDK Version: 1.6.x.x.

Attached the context.xml file of Lab and Prod server.

Kindly help me to know the exact issue and solution for the above.


Filename context_prod.xml [Disk] Download
  • [Thumb - DB_validate_error.jpg]
[Disk] Download
Filename context_lab.xml [Disk] Download
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
There are 2 different problems here. First the context.xml is not automatically copied to config/catalina/localhost. Actually, it is a configuration on Tomcat that you can decide whether you want the file to be copied (refer to the link below and look for copyXML). I think starting Tomcat 7, not copying is the default. The application can use context.xml instead. So this is not your problem.

https://tomcat.apache.org/tomcat-7.0-doc/config/host.html

You problem is actually the format of the context.xml. The format is for Tomcat 5.5. Were you running Tomcat 5.5 in the your OD design environment? The one you copied from production is for Tomcat 6 and Tomcat 7. That's why it works.
MaragathamAnjali
Joined: Oct 9, 2015
Messages: 12
Offline
1)I have to add copyXML="true" as below in server.xml of tomcat7, in order to get context.xml(<appname>.xml) automatically copied to config/catalina/localhost

<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" copyXML="true">

2)In tomcat 6(prod environment),
The context.xml file under <appname>/META-INF/context.xml is generated with DB details as in below format.

<Resource auth="Container" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" factory="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" name="jdbc/ConnEstSqlserverCPDS" type="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" url="jdbc:sqlserver://xx.xxx.xx.xx:1433;DatabaseName=XXX"/>
<Resource auth="Container" dataSourceName="java:/comp/env/jdbc/ConnEstSqlserverCPDS" defaultMaxActive="10" defaultMaxIdle="5" defaultMaxWait="10000" factory="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSourceFactory" logAbandoned="true" name="jdbc/ConnEstSqlserver" removeAbandoned="true" removeAbandonedTimeout="300" testOnBorrow="false" type="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSource" validationQuery="select 1 from AnyTable"/>
<Resource auth="Container" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" factory="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" name="jdbc/ConnEstSqlserverStandbyCPDS" type="org.apache.tomcat.dbcp.dbcp.cpdsadapter.DriverAdapterCPDS" url="jdbc:sqlserver://xx.xxx.xx.xx:1433;DatabaseName=XXX"/>
<Resource auth="Container" dataSourceName="java:/comp/env/jdbc/ConnEstSqlserverStandbyCPDS" defaultMaxActive="10" defaultMaxIdle="5" defaultMaxWait="10000" factory="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSourceFactory" logAbandoned="true" name="jdbc/ConnEstSqlserverStandby" removeAbandoned="true" removeAbandonedTimeout="300" testOnBorrow="false" type="org.apache.tomcat.dbcp.dbcp.datasources.PerUserPoolDataSource" validationQuery="select 1 from AnyTable"/>


But in tomcat7,(Lab Environment),The context.xml file under <appname>/META-INF/context.xml is generated with DB details as in below format.

<Resource auth="Container" name="jdbc/ConnEstSqlserverCPDS" type="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS"/>
<ResourceParams name="jdbc/ConnEstSqlserverCPDS">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS</value>
</parameter>
<parameter>
<name>driver</name>
<value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:sqlserver://xx.xxx.xx.xx:1433;DatabaseName=XXX</value>
</parameter>
</ResourceParams>
<Resource auth="Container" name="jdbc/ConnEstSqlserver" type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource"/>
<ResourceParams name="jdbc/ConnEstSqlserver">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
</parameter>
<parameter>
<name>dataSourceName</name>
<value>java:/comp/env/jdbc/ConnEstSqlserverCPDS</value>
</parameter>
<parameter>
<name>defaultMaxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>defaultMaxIdle</name>
<value>5</value>
</parameter>
<parameter>
<name>defaultMaxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>300</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select 1 from AnyTable</value>
</parameter>
<parameter>
<name>testOnBorrow</name>
<value>false</value>
</parameter>
</ResourceParams>
<Resource auth="Container" name="jdbc/ConnEstSqlserverStandbyCPDS" type="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS"/>
<ResourceParams name="jdbc/ConnEstSqlserverStandbyCPDS">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS</value>
</parameter>
<parameter>
<name>driver</name>
<value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:sqlserver://xx.xxx.xx.xx:1433;DatabaseName=XXX</value>
</parameter>
</ResourceParams>
<Resource auth="Container" name="jdbc/ConnEstSqlserverStandby" type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource"/>
<ResourceParams name="jdbc/ConnEstSqlserverStandby">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
</parameter>
<parameter>
<name>dataSourceName</name>
<value>java:/comp/env/jdbc/ConnEstSqlserverStandbyCPDS</value>
</parameter>
<parameter>
<name>defaultMaxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>defaultMaxIdle</name>
<value>5</value>
</parameter>
<parameter>
<name>defaultMaxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>300</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select 1 from AnyTable</value>
</parameter>
<parameter>
<name>testOnBorrow</name>
<value>false</value>
</parameter>
</ResourceParams>

With this context.xml (generated using tomcat 7),the DB connection gets failed.

Only after updating this file with tomcat6 context.xml file format,DB gets connected successfully.

How can we establish the DB connection success without updating the file manually.
And why the DB gets failed for the tomcat7 context.xml file format.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
In the OD environment where you exported the war, can you check the Tomcat home setting in Preferences? If the OD environment is using an older version of Tomcat it generates the context.xml in the wrong format. I don't see any problem here when my OD is pointing to Tomcat 7.0. You probably try to remove the old context first by using the project's right-click menu option Tomcat Project->Remove context and then do an update using Orchestration Designer->Update Context.
MaragathamAnjali
Joined: Oct 9, 2015
Messages: 12
Offline
I am using eclipse with OD 6.0.11.03 where i could find only tomcat 5 and 6 under Window-->preference --> Tomcat.

But i updated the Tomcat home to point to Tomcat 7.0.69.

I removed the Tomcat context and Update the OD Context.Exported the jar and deployed in tomcat 7.0.69.I ran start.bat under tomcat/bin.I checked context.xml under META-INF of the Application extracted folder.But the context.xml is same as i mentioned for LAB environment.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
If it only shows Tomcat 5 and 6 options on the preference screen, it doesn't look like it's 6.0.11. Can you post a screenshot of that?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Can you upgrade to 6.0.13 which is the latest for 6.0?
Go to:   
Mobile view