You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tom Robinson <to...@constantstream.com> on 2007/11/30 16:49:35 UTC

can't undeploy webapp with manager

Hi,

I'm having trouble with the manager webapp not removing the unpacked WAR after
an undeploy. The result is that tomcat just redploys the webapp immediately! Do
I have an incorrectly configured manager? Is the webapp itself to blame? I've
pasted my context (ROOT.xml) and server.xml below with a few more comments on
various <Host> settings I thought might work. Any help is appreciated.

Thanks,

TOm


Platform CentOS 5

http://kennetproject/manager/serverinfo
OK - Server info
Tomcat Version: Apache Tomcat/5.5.25
OS Name: Linux
OS Version: 2.6.18-8.1.15.el5xen
OS Architecture: i386
JVM Version: 1.6.0_03-b05
JVM Vendor: Sun Microsystems Inc.

http://kennetproject/manager/list
OK - Listed applications for virtual host kennetproject.int.intelligentspace.com
/:stopped:0:/usr/share/tomcat5/temp/1-ROOT
/manager:running:0:/var/lib/tomcat5/server/webapps/manager


context is ROOT.xml
<Context docBase="${catalina.home}/ispace/projectpro.war"
    antJARLocking="true"
    antiResourceLocking="true"
    debug="16">

    <!-- JDBC resource -->
    <Resource name="jdbc/projects" auth="Container"
        scope="Shareable" type="javax.sql.DataSource"/>
    <!-- JDBC resource parameters -->
        <ResourceParams name="jdbc/projects">
            <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <parameter>
                <name>username</name>
                <value>project</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value>project</value>
            </parameter>
            <parameter>
                <name>driverClassName</name>
                <value>com.mysql.jdbc.Driver</value>
            </parameter>
            <parameter>
                <name>url</name>

<value>jdbc:mysql://localhost:3306/projects?zeroDateTimeBehavior=convertToNull</value>
            </parameter>
            <parameter>
                <name>maxWait</name>
                <value>3000</value>
            </parameter>
            <parameter>
                <name>maxIdle</name>
                <value>5</value>
            </parameter>
            <parameter>
                <name>maxActive</name>
                <value>10</value>
            </parameter>
        </ResourceParams>

    <!-- mail resource -->
    <Resource name="mail/default" auth="Container" type="javax.mail.Session"/>
    <!-- mail resource parameters -->
        <ResourceParams name="mail/default">
            <parameter>
                <name>mail.smtp.host</name>
                <value>localhost</value>
            </parameter>
        </ResourceParams>

    <!-- Environment -->
    <Environment name="passwords/db.salary.field.aes.key"
        value="howdoiopendoors?" type="java.lang.String" override="false"/>
</Context>

server.xml
              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" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />
      <Host name="localhost" appBase="webapps" />
    </Engine>

  </Service>

  <!-- Parchment Service Begin -->
  <Service name="Parchment">

    <Connector port="8010"
        protocol="AJP/1.3"
        enableLookups="false"
        redirectPort="8443"
        allowTrace="true"
        debug="20"/>

    <Engine name="Parchment"
defaultHost="kennetproject.int.intelligentspace.com" debug="20">

        <Valve className="org.apache.catalina.valves.RequestDumperValve"/>

        <!-- Define the global realm for Parchment -->
        <Realm className="org.apache.catalina.realm.JNDIRealm"
            debug="20"
            connectionName="xxxxxxxxxxxxxxxxxx"
            connectionPassword="xxxxxxxxxxxxxxxx"
            connectionURL="xxxxxxxxxxxxxxxxx"
            userPattern="xxxxxxxxxxxxxxxxxxxxx"
            roleBase="xxxxxxxxxxxxxxxxxxxxxx"
            roleName="xxxxxxxxxxxxxxxx"
            roleSearch="xxxxxxxxxxxxxxx"/>

        <!-- project host Begin -->
        <Host name="kennetproject.int.intelligentspace.com"
            debug="20"
            appBase="webapps/project"
            unpackWARs="true"
            deployXML="false"
            autoDeploy="true">

            <Alias>kennetproject</Alias>

        </Host>
        <!-- project host End -->

    </Engine>

  </Service>
  <!-- Parchment Service End -->

</Server>

I've also tried fiddling with the <Host>:

        <!-- project host Begin -->
        <!-- autoDeploy="true"-->
        <!-- unpackWARs="true"-->
        <Host name="kennetproject.int.intelligentspace.com"
            debug="20"
            appBase="webapps/project"
            deployXML="false">

            <Alias>kennetproject</Alias>

        </Host>
        <!-- project host End -->

But nothing works!

-- 
Thomas Robinson -

   Infrastructure, Integration, Support, Development and Training
   Linux, Oracle, Windows, Networking

   Daedalus Compass Ltd                   Mobile: +44 (0)7879 428 968
   132 Clifden Court, Clifden Road          Work: +44 (0)20 8891 6262
   Twickenham, Middlesex, TW1 4LR            Fax: +44 (0)20 8891 6363
   United Kingdom                        GPG Key: 8A4CB7A7

   CONFIDENTIALITY: Copyright (C). This message with any appended or
   attached material is intended for addressees only and may not be
   copied or forwarded to or used by other parties without permission.

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


Re: can't undeploy webapp with manager

Posted by Tom Robinson <to...@constantstream.com>.
Caldarale, Charles R wrote:
>> From: Tom Robinson [mailto:tom@constantstream.com] 
>> Subject: Re: can't undeploy webapp with manager
>>
>> I want a separate <Engine>.
> 
> I'm still curious: why?
The <Service> represents my dedicated <Connector>(s) for my <Engine>. My
<Engine> is therefore wholly responsible for receiving and processing all
requests for the <Connector>'s in my <Service> (and not for any other service
connectors). Setting it up this way I know what my connector ports are being
used for. Maybe I'm mistaken on the usage for this specific flexibility in the
tomcat setup. Also, I think I had some problems isolating connector ports on
earlier tomcat versions (3 or 4?). I'm open to comments though, so please
elaborate on the above.

> 
>> There is a need for more than one virtual host.
> 
> Multiple <Host> elements are allowed inside a single <Engine>.
Correct. Earlier, I had two <Host>'s in my Parchment <Service>.

> 
>> The ROOT.xml stays and redeploys the .war from the 
>> docBase. Why doesn't it get removed?
> 
> Is there a permissions problem?  Make sure the Tomcat userid is allowed
> to delete the ROOT.xml file from that directory.
Doh! I had some earlier setup/config problems and did a fresh install of tomcat,
etc. Must have overlooked the permission changes on these directories. Now the
permissions are changed so the group ownership is correctly set to the tomcat
group (copied the ${CATALINA_HOME/conf/Catalina directory settings):

drwxrwxr-x 3 root tomcat 4096 Nov 29 22:28 Parchment
drwxrwxr-x 2 root tomcat 4096 Dec  2 21:47
Parchment/kennetproject.int.intelligentspace.com

Undeploy now stops the application and removes the ROOT.war but not the unpacked
war ROOT from appBase directory or the ROOT.xml from the
${CATALINA_HOME}/conf/[Engine]/[Host] directory.

http://kennetproject/manager/list
OK - Listed applications for virtual host kennetproject.int.intelligentspace.com
/:stopped:0:ROOT
/manager:running:0:/var/lib/tomcat5/server/webapps/manager

A second undeploy immediately following the first removes the ROOT.xml from
${CATALINA_HOME}/conf/[Engine]/[Host] and the unpacked war ROOT directory from
the appBase. I guess this is somewhat of a success but not entirely what I'd expect.

http://kennetproject:12380/manager/list
OK - Listed applications for virtual host kennetproject.int.intelligentspace.com
/manager:running:0:/var/lib/tomcat5/server/webapps/manager

Interestingly, I can start/stop the application after the first undeploy. Tomcat
uses the unpacked .war and the existing ROOT.xml.

I appreciate the feed back so thanks again,

Tom

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


RE: can't undeploy webapp with manager

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tom Robinson [mailto:tom@constantstream.com] 
> Subject: Re: can't undeploy webapp with manager
> 
> I want a separate <Engine>.

I'm still curious: why?

> There is a need for more than one virtual host.

Multiple <Host> elements are allowed inside a single <Engine>.

> The ROOT.xml stays and redeploys the .war from the 
> docBase. Why doesn't it get removed?

Is there a permissions problem?  Make sure the Tomcat userid is allowed
to delete the ROOT.xml file from that 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't undeploy webapp with manager

Posted by Tom Robinson <to...@constantstream.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Caldarale, Charles R wrote:
>> From: Tom Robinson [mailto:tom@constantstream.com] 
>> Subject: can't undeploy webapp with manager
>>
>> I've pasted my context (ROOT.xml) and server.xml below 
>> with a few more comments on various <Host> settings
> 
> This is certainly an unusual configuration; whether or not that's
> contributing to the issue isn't clear.

Thanks for taking a look in any case.

> 
> 1) Why do you have an additional <Service> configured?  I can't imagine
> an environment where that's really needed.

I want a separate <Engine>. <Service> is allowed only one.

> 
> 2) The appBase settings for the two <Host> elements overlap - never a
> good thing.  These should be distinct, assuming you really need two
> <Host>s in the first place.
There is a need for more than one virtual host. I didn't understand the
documentation on appBase overlap. I was reading the
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html and saw there
webapps/ren and webapps/stimpy. I take it these don't overlap. But I had webapps
and webapps/project, which do.

> 3) Where is your ROOT.xml located?  To which <Host> does it belong?
The ROOT.xml is ${CATALINA_HOME}/conf/Parchment/kennet.int.intelligentspace.com.
It belongs to the kennet.int.intelligentspace.com <host>.

> 
> 4) Have you deployed a separate Manager for each <Host>?
Yes.
${CATALINA_HOME}/conf/Parchment/kennet.int.intelligentspace.com/manager.xml.
There's another one in ${CATALINA_HOME}/conf/Catalina/localhost.

> 5) The antiJARLocking and antiResourceLocking aren't needed on Linux
> systems, and may be causing some odd interactions with the Manager.
Yeah, thanks. I noticed that after reading a few more docs and posts. I've
removed them.

> I haven't had any problems with undeploying the default app using a more
> typical Tomcat configuration, even when the .war is outside of the
> appBase directory.
> 
> Is your ROOT.xml being deleted by the undeploy?  (It should be.)  You
> might try simplifying your setup and see what happens.
This is the problem I think. The ROOT.xml stays and redeploys the .war from the
docBase. Why doesn't it get removed?

I now have server.xml reconfigured without the webapps overlap on the two
<Host>'s but it still redeploys after undeploy. The context XML (ROOT.xml) is
also modified so the docBase=ispace/docbase.

For thoroughness, I tried a simplified server.xml with only one <Service> but
still have the same problem. Pasted below are both for perusal.

Thanks for your help

Tom
- ---

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

  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <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" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />
      <Host name="localhost" appBase="webapps" />
    </Engine>

  </Service>

  <!-- Parchment Service Begin -->
  <Service name="Parchment">

    <Connector port="8010"
        protocol="AJP/1.3"
        enableLookups="false"
        redirectPort="8443"
        allowTrace="true"
        debug="20"/>

    <Engine name="Parchment"
defaultHost="kennetproject.int.intelligentspace.com" debug="20">

        <Valve className="org.apache.catalina.valves.RequestDumperValve"/>

        <!-- Define the global realm for Parchment -->
        <Realm className="org.apache.catalina.realm.JNDIRealm"
            debug="20"
            connectionName="xxxxxxxxxxxxxx"
            connectionPassword="xxxxxxxxxxxxxx"
            connectionURL="xxxxxxxxxxxxxx"
            userPattern="xxxxxxxxxxxxxx"
            roleBase="xxxxxxxxxxxxxx"
            roleName="xxxxxxxxxxxxxx"
            roleSearch="xxxxxxxxxxxxxx"

        <Host name="kennetproject.int.intelligentspace.com"
            appBase="ispace/webapps/project"
            unpackWARs="true"
            debug="20">

            <Alias>kennetproject</Alias>

        </Host>
        <!-- project host End -->

    </Engine>

  </Service>
  <!-- Parchment Service End -->

</Server>

Context (ROOT.xml)
<Context docBase="${catalina.home}/ispace/docbase/projectpro.war"
    debug="16">

    <!-- JDBC resource -->
    <Resource name="jdbc/projects"
        auth="Container"
        type="javax.sql.DataSource"
        maxActive="10"
        maxIdle="5"
        maxWait="3000"
        username="xxxxxxx"
        password="xxxxxxx"
        driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/projects?zeroDateTimeBehavior=convertToNull"
        scope="Shareable"
        factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    />

<!--
        factory="org.apache.commons.dbcp.BasicDataSourceFactory"
- -->

    <!-- mail resource -->
    <Resource name="mail/default" auth="Container" type="javax.mail.Session"/>
    <!-- mail resource parameters -->
        <ResourceParams name="mail/default">
            <parameter>
                <name>mail.smtp.host</name>
                <value>localhost</value>
            </parameter>
        </ResourceParams>

    <!-- Environment -->
    <Environment name="passwords/db.salary.field.aes.key"
        value="xxxxxxxxxxxxx" type="java.lang.String" override="false"/>
</Context>

Alternative server.xml
<Server port="8005" shutdown="SHUTDOWN">

  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <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" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Connector port="8010" protocol="AJP/1.3"
      enableLookups="false"
      redirectPort="8443"
      allowTrace="true"
      debug="20"/>

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

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

      <Realm className="org.apache.catalina.realm.JNDIRealm"
        debug="20"
        connectionName="xxxxxxx"
        connectionPassword="xxxxxxx"
        connectionURL="xxxxxxx"
        userPattern="xxxxxxx"
        roleBase="xxxxxxx"
        roleName="xxxxxxx"
        roleSearch="xxxxxxx"/>

      <Host name="localhost" appBase="webapps" />

      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>

      <Host name="kennetproject.int.intelligentspace.com"
        appBase="ispace/webapps/project"
        unpackWARs="true"
        debug="20">

        <Alias>kennetproject</Alias>

      </Host>
    </Engine>
  </Service>

</Server>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org

iD8DBQFHUsGpTTfAzopMt6cRAlvxAJ9gCXMw9v1kY3+gELvo8sEsCHBuygCcCytp
9ZZSFALT+IpDIXY7RRjahsA=
=tF0E
-----END PGP SIGNATURE-----

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


RE: can't undeploy webapp with manager

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tom Robinson [mailto:tom@constantstream.com] 
> Subject: can't undeploy webapp with manager
> 
> I've pasted my context (ROOT.xml) and server.xml below 
> with a few more comments on various <Host> settings

This is certainly an unusual configuration; whether or not that's
contributing to the issue isn't clear.

1) Why do you have an additional <Service> configured?  I can't imagine
an environment where that's really needed.

2) The appBase settings for the two <Host> elements overlap - never a
good thing.  These should be distinct, assuming you really need two
<Host>s in the first place.

3) Where is your ROOT.xml located?  To which <Host> does it belong?

4) Have you deployed a separate Manager for each <Host>?

5) The antiJARLocking and antiResourceLocking aren't needed on Linux
systems, and may be causing some odd interactions with the Manager.

I haven't had any problems with undeploying the default app using a more
typical Tomcat configuration, even when the .war is outside of the
appBase directory.

Is your ROOT.xml being deleted by the undeploy?  (It should be.)  You
might try simplifying your setup and see what happens.

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org