I tried as you suggested. But didn't work. I have cleaned up tomcat
deployment directories and currently the configuration is very simple.
 
Under $CATALINA_HOME/webapps, there is only one directory ROOT.
Under $CATALINA_HOME/Catalina, there is  only one directory "localhost",
which in turn only contains 1 file trip.xml

   <?xml version='1.0' encoding='utf-8'?>
<Context docBase="d:/dev/trip/main/build">
    <Resource name="jdbc/trip" auth="Container" 
        type="javax.sql.DataSource"
        username="sa"
        password="xxxxx" 
        driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
        url="jdbc:microsoft:sqlserver://localhost:1433;databaseName=trip"
        maxActive="8" 
        maxIdle="4"/>

    <WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Note: as suggested, I have moved the above entry from context.xml over
here. -->
  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="local_cutetrip." suffix=".log"
          timestamp="true"/>

</Context>

$CATALINA_HOME/conf/server.xml is as following:

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener
className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

  <GlobalNamingResources>

    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />

  </GlobalNamingResources>

  <Service name="Catalina">

    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
        
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3"
/>

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>


      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

      </Host>

    </Engine>

  </Service>

</Server>

$CATALINA_HOME/conf/context.xml is:
<Context>
</Context>



Caldarale, Charles R wrote:
> 
>> From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] 
>> Subject: Re: Context started twice
>> 
>> Seems to me that the Context is defined in 2 places First:
>> > context.xml is empty except this line
>> > <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> 
>> I would suggest moving
>> <WatchedResource>WEB-INF/web.xml</WatchedResource> also inside
>> trip.xml
>> 
>> And change the /META-INF/context.xml entry to <Context/>
> 
> The OP doesn't have a META-INF/context.xml file; the one being talked
> about is the global one in conf/context.xml, which applies to all
> deployed apps.  Moving the <WatchedResource> element is unnecessary.
> 
> Creating a META-INF/context.xml is useless, since the
> conf/Catalina/localhost/trip.xml will override it.
> 
> None of which explains why the init() method of the servlet in question
> is being called twice.  Is there another copy of the trip application
> deployed under Tomcat's webapps directory?
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Context-started-twice-tf3664516.html#a10247619
Sent from the Tomcat - User mailing list archive at Nabble.com.


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

Reply via email to