Shaji
asked on
Manually editing META-INF/context.xml after deploying the .war file in Tomcat is not working
We have three setup one for development, and another for testing and the third one for production. We have different MySQL database servers for each setup. Once the development team releases the builld including a war file with MD5 checksum, the testing team takes the respective build and pick up the war file and deploy in their test server running Tomcat. The database username and password is different for each setup (i.e dev, test and production).
We are using database connection pooling in our webapp and the QA needs to configure the META-INF/context.xml with the MySQL credentials. They use Tomcat manager to deploy the app and then they perform a FTP to the server and edit the context.xml.
The above approach is not working, as a workaround, the QA imports the war file in Eclipse and then edit the context.xml in Eclipse and then export the war file and then redeploy it in Tomcat (i.e in Test server)
We are using a custom MVC framework using JSP and Servlets.
The context.xml file is pasted here for convenience
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/SSG">
<!-- the ssg database that contains admin username and password and database connection pooling -->
<Resource
name="jdbc/ssg"
auth="Container"
type="javax.sql.DataSource "
factory="org.apache.tomcat .jdbc.pool .DataSourc eFactory"
initialSize="15"
maxActive="250"
maxIdle="120"
minIdle="60"
timeBetweenEvictionRunsMil lis="34000 "
minEvictableIdleTimeMillis ="55000"
validationQuery="SELECT 1"
validationInterval="34000"
testOnBorrow="true"
removeAbandoned="true"
removeAbandonedTimeout="55 "
username="ssg"
password="EvMUijh7g8i56uWV FQNGBVE"
driverClassName="com.mysql .jdbc.Driv er"
url="jdbc:mysql://example. com:3306/s sg?allowMu ltiQueries =true"
/>
</Context>
Is there any way to edit the context.xml manually using FTP so that the QA can pick up the war file and then directly deploy it in Tomcat instead of reexporting the war file in Eclipse and then make necessary changes in context.xml?
We are using database connection pooling in our webapp and the QA needs to configure the META-INF/context.xml with the MySQL credentials. They use Tomcat manager to deploy the app and then they perform a FTP to the server and edit the context.xml.
The above approach is not working, as a workaround, the QA imports the war file in Eclipse and then edit the context.xml in Eclipse and then export the war file and then redeploy it in Tomcat (i.e in Test server)
We are using a custom MVC framework using JSP and Servlets.
The context.xml file is pasted here for convenience
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/SSG">
<!-- the ssg database that contains admin username and password and database connection pooling -->
<Resource
name="jdbc/ssg"
auth="Container"
type="javax.sql.DataSource
factory="org.apache.tomcat
initialSize="15"
maxActive="250"
maxIdle="120"
minIdle="60"
timeBetweenEvictionRunsMil
minEvictableIdleTimeMillis
validationQuery="SELECT 1"
validationInterval="34000"
testOnBorrow="true"
removeAbandoned="true"
removeAbandonedTimeout="55
username="ssg"
password="EvMUijh7g8i56uWV
driverClassName="com.mysql
url="jdbc:mysql://example.
/>
</Context>
Is there any way to edit the context.xml manually using FTP so that the QA can pick up the war file and then directly deploy it in Tomcat instead of reexporting the war file in Eclipse and then make necessary changes in context.xml?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks mccarl.