Jeffrey C. Baldwin wrote:
P,

(our messages crossed, I think)

Looks like you've got the context setup in the server.xml AND the external file. You only need one location, comment out the Context definition in server.xml and we'll work on getting the auto-deploy to work from the WAR/webapp.


p




This is everything from server.xml

<?xml version='1.0' encoding='utf-8'?>
<Server>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <Resource auth="Container" description="User database that can be
updated and saved" name="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true" port="8080" redirectPort="8443"
maxSpareThreads="75" maxThreads="150"
minSpareThreads="25">
    </Connector>
    <Connector port="8009" protocol="AJP/1.3"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
redirectPort="8443">
    </Connector>
    <Engine defaultHost="localhost" name="Catalina">
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="fal
se" />
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true" />
<Context debug="0" docBase="mrs2" path="/mrs2" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_mrs2_log." suffix=".txt" timestamp="true"/>
                   <Resource name="jdbc/ZosDataSource" auth="Container"
type="javax.sql.DataSource"></Resource>
                   <ResourceParams name="jdbc/ZosDataSource">
                       <parameter>
                           <name>factory</name>

<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                       </parameter>
                       <parameter>
                           <name>maxActive</name>
                           <value>5</value>
                       </parameter>
                       <parameter>
                           <name>maxIdle</name>
                           <value>1</value>
                       </parameter>
                       <parameter>
                           <name>maxWait</name>
                           <value>10000</value>
                       </parameter>
                       <parameter>
                           <name>username</name>
                           <value>TS59MRS</value>
                       </parameter>
                       <parameter>
                           <name>password</name>
                           <value>password</value>
                       </parameter>
                       <parameter>
                           <name>driverClassName</name>
                           <value>com.ibm.db2.jcc.DB2Driver</value>
                       </parameter>
                       <parameter>
                           <name>url</name>

<value>jdbc:db2://123.456.789.120:5019/NETSNDB01</value>  <!--
production 123.456.789.120:5019/NETSNDB01 -->
                       </parameter>
                   </ResourceParams>
                   <Resource name="jdbc/mssql2000ds" auth="Container"
type="javax.sql.DataSource"></Resource>
                   <ResourceParams name="jdbc/mssql2000ds">
                       <parameter>
                           <name>factory</name>

<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                       </parameter>
                       <parameter>
                           <name>maxActive</name>
                           <value>10</value>
                       </parameter>
                       <parameter>
                           <name>maxIdle</name>
                           <value>1</value>
                       </parameter>
                       <parameter>
                           <name>maxWait</name>
                           <value>10000</value>
                       </parameter>
                       <parameter>
                           <name>username</name>
                           <value>rreddy</value>
                       </parameter>
                       <parameter>
                           <name>password</name>
                           <value>password</value>
                       </parameter>
                       <parameter>
                           <name>driverClassName</name>
                           <value>net.sourceforge.jtds.jdbc.Driver</value>
                       </parameter>
                       <parameter>
                           <name>url</name>

<value>jdbc:jtds:sqlserver://123.456.789.96/mrs;user=rreddy;password=pv123ankita</value>
                        </parameter>
                   </ResourceParams>
                        </Context>
                        </Host>
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    </Engine>
  </Service>
</Server>



Pid wrote:
Jeffrey C. Baldwin wrote:
Chris,

Thank you for the time. However, I'm still not having any luck...
What's in your Host definition in server.xml, can you post that too?

p


Again, I have the entries in server.xml, so if I restart the Tomcat
service AFTER deploying the app, all is well.  However, I want the
application developers to be able to deploy their app and not have to,
or need to contact me to, restart the Tomcat service.

Thanks again!

In:
/usr/local/tomcat/webapps/mrs2/META-INF

I have:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/usr/local/tomcat/webapps/mrs2" path="/mrs2"
workDir="work/Catalina/localhost/mrs2">
  <Resource auth="Container" description="zos DB2 Connection"
name="jdbc/ZosDataSource" type="javax.sql.DataSource"/>
  <Resource auth="Container" description="local DB2 Connection"
name="jdbc/db2ds" type="javax.sql.DataSource"/>
  <Resource auth="Container" description="msql DB Connection"
name="jdbc/mssql2000ds" type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/ZosDataSource">
    <parameter>
      <name>maxWait</name>
      <value>10000</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>2</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>test</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:db2://123.456.789.120:5019/NETSNDB01</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>com.ibm.db2.jcc.DB2Driver</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>1</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>TS59MRS</value>
    </parameter>
  </ResourceParams>
  <ResourceParams name="jdbc/db2ds">
    <parameter>
      <name>driverClassName</name>
      <value></value>
    </parameter>
  </ResourceParams>
  <ResourceParams name="jdbc/mssql2000ds">
    <parameter>
      <name>maxWait</name>
      <value>10000</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>2</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>password</value>
    </parameter>
    <parameter>
      <name>url</name>
<value>jdbc:jtds:sqlserver://123.456.789.96/mrsuat;user=rreddy;password=password</value>

    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>net.sourceforge.jtds.jdbc.Driver</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>1</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>rreddy</value>
    </parameter>
  </ResourceParams>
</Context>


Christopher Schultz wrote:
Jeffrey,

Jeffrey C. Baldwin wrote:
I appreciate all the input guys.  I put everything into server.xml and
the application is working great.
You should put that setup into META-INF/context.xml in your webapp
directory (or your WAR file) instead of into server.xml. This is likely
to fix your problem.

So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?
Restart the entire Tomcat service? I don't think Tomcat includes this
capability. You'd have to write your own, separate utility app that can
take down and restart Tomcat.

Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?
No, it's not. Configuring those connections in context.xml will
certainly alleviate this problem.

-chris

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to