You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shilpa Nalgonda <sn...@mypublisher.com> on 2004/11/22 18:10:49 UTC

RE:Server.xml problem..

Hi ,
I am usinh ant deploy target to deploy my web application  on  Tomcat
4.1.30.
I have configured datasource to get the connection pooling  for my webapp
in server.xml.

But whenever i do a ant deploy, the server.xml ia being backed up and a new
server.xml is created.
This new server.xml does not have any of my datasouce configuration for my
webapp.  So my application cannot connect to the database thereby.

How can i resolve this, do i have to write xml file for my webapp, if so
what entries go in that new xml file.  Below is
my ant deploy target and server.xml

<target name="deploy" depends="compile"
   description="Deploying application to servlet container">

    <deploy url="${manager.url}"
        username="${manager.username}"
        password="${manager.password}"
            path="${app.path}"
             war="file:/${dist.home}/rpcoemapi.war"/>

  </target>

sErver.xml
----------
    <!-- JNDI datasource setup to connect to Oracle database for
xmlrpc-oemapi-->
     	<Context path="/rpcoemapi" docBase="rpcoemapi"
        	debug="5" reloadable="true" crossContext="true" useNaming="true">

  	<Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_rpcoemapi_log." suffix=".txt"
             timestamp="true"/>
       <Resource name="jdbc/MYDS"
               auth="Container"
               type="javax.sql.DataSource"/>

  	<ResourceParams name="jdbc/MYDS">
    	<parameter>
      	  <name>factory</name>
      	  <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    	</parameter>
        <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
         -->
    	<parameter>
          <name>maxActive</name>
          <value>30</value>
        </parameter>

    	<!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.
         -->
        <parameter>
         <name>maxIdle</name>
         <value>20</value>
        </parameter>


   	 <!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely.
         -->
    	<parameter>
         <name>maxWait</name>
         <value>10000</value>
        </parameter>

    	<!-- MySQL dB username and password for dB connections  -->
    	<parameter>
     	  <name>username</name>
     	  <value>xx</value>
    	</parameter>
    	<parameter>
     	  <name>password</name>
     	  <value>xx</value>
    	</parameter>

    	<!-- Class name for mm.mysql JDBC driver -->
    	<parameter>
       	  <name>driverClassName</name>
       	  <value>oracle.jdbc.driver.OracleDriver</value>
    	</parameter>

    	<!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed
the
         connection.  mysqld by default closes idle connections after 8
hours.
         -->
    	<parameter>
      	<name>url</name>
      	<value>jdbc:oracle:thin:@ipaddress:1521:DB</value>
   	</parameter>
</ResourceParams>
</Context>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org