You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ken Bowen <kb...@als.com> on 2007/10/18 13:42:30 UTC

Problem installing application context as ROOT

Hi All,

I'm having a problem installing my application to run as the ROOT context.
The problem is in getting Tomcat to expand ROOT.war.

I can make things work as follows:

1. Use ant to create myapp.war, and upload it to the isp.
2. Drop myapp.war in ~tomcat5/webapps; Tomcat expands myapp.war to myapp/
3. Stop Tomcat; rename myapp/ to ROOT/, and delete myapp.war
4. Restart Tomcat;  after a delay (maybe 1-2 min), myapp is running as 
ROOT/ .

But the following doesn't work:

a. Stop Tomcat; remove everything in webapps
b. Copy myapp.war into webapps, and rename it to ~/tomcat5/webapps/ROOT.war
c. Restart Tomcat

No matter how long I wait (say 5 min),  while making requests for the
root context from a browser, ROOT.war doesn't get expanded, and all I get
in the browser is "/ is unavailable".  [In contrast, when I drop myapp.war
into webapps, it is almost instantly expanded to myapp/ ]

I've also tried starting the Tomcat manager.  It falsly claims that "/" 
is running.
I've asked it to Stop and then Start "/", but that doesn't help.

Some details:

Tomcat 5.5.25  Java 1.5.0_12

The Host spec from server.xml:

<Host appBase="webapps" name="myaddress.com" unpackWARs="true" 
autoDeploy="true">
    <Context path="/manager" 
docBase="/opt/tomcat5/server/webapps/manager" privileged="true" debug="0"/>
    <Context path="/admin" docBase="/opt/tomcat5/server/webapps/admin" 
privileged="true" debug="0"/>
</Host>

The META-INF/context.xml for myapp:

<Context path="" debug="5" reloadable="true" crossContext="true">
   <Resource name="jdbc/sb_data" auth="Container" 
type="javax.sql.DataSource"
       maxActive="100" maxIdle="30" maxWait="10000"
       username="XXXXX" password="XXXXX"
       driverClassName="com.mysql.jdbc.Driver"
       url="jdbc:mysql://localhost:3306/sb_data"/>
   <Resource name="jdbc/sb_users" auth="Container" 
type="javax.sql.DataSource"
       maxActive="100" maxIdle="30" maxWait="10000"
       username="XXXXX" password="XXXXX"
       driverClassName="com.mysql.jdbc.Driver"
       url="jdbc:mysql://localhost:3306/sb_users"/>
</Context>

Does anyone have any tips for how I could carry out installs of 
myapp.war as ROOT.war and
get it expanded?  Steps 1-4 are a little bit awkward.

If I have to, I assume I could slightly streamline 1-4 by first stopping 
the root app (/) with
the manager, dropping in the new ROOT.war,  and then executing

    jar -xf ./ROOT.war

Does this expand ROOT.war exactly as Tomcat does?

Thanks in advance,
Ken Bowen





---------------------------------------------------------------------
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: Problem installing application context as ROOT

Posted by Ken Bowen <kb...@als.com>.
It seems to that's what I did in steps a-c when I renamed myapp.war to 
ROOT.war before restarting Tomcat.??

Auke Noppe wrote:
> Try to build your app as ROOT.war.
> Because tomcat extracts the war-file, and makes some copies to tmp and work
> dirs.
>
>
>
> -----Oorspronkelijk bericht-----
> Van: Ken Bowen [mailto:kbowen@als.com] 
> Verzonden: donderdag 18 oktober 2007 13:43
> Aan: users@tomcat.apache.org
> Onderwerp: Problem installing application context as ROOT
>
> Hi All,
>
> I'm having a problem installing my application to run as the ROOT context.
> The problem is in getting Tomcat to expand ROOT.war.
>
> I can make things work as follows:
>
> 1. Use ant to create myapp.war, and upload it to the isp.
> 2. Drop myapp.war in ~tomcat5/webapps; Tomcat expands myapp.war to myapp/
> 3. Stop Tomcat; rename myapp/ to ROOT/, and delete myapp.war
> 4. Restart Tomcat;  after a delay (maybe 1-2 min), myapp is running as 
> ROOT/ .
>
> But the following doesn't work:
>
> a. Stop Tomcat; remove everything in webapps
> b. Copy myapp.war into webapps, and rename it to ~/tomcat5/webapps/ROOT.war
> c. Restart Tomcat
>
> No matter how long I wait (say 5 min),  while making requests for the
> root context from a browser, ROOT.war doesn't get expanded, and all I get
> in the browser is "/ is unavailable".  [In contrast, when I drop myapp.war
> into webapps, it is almost instantly expanded to myapp/ ]
>
> I've also tried starting the Tomcat manager.  It falsly claims that "/" 
> is running.
> I've asked it to Stop and then Start "/", but that doesn't help.
>
> Some details:
>
> Tomcat 5.5.25  Java 1.5.0_12
>
> The Host spec from server.xml:
>
> <Host appBase="webapps" name="myaddress.com" unpackWARs="true" 
> autoDeploy="true">
>     <Context path="/manager" 
> docBase="/opt/tomcat5/server/webapps/manager" privileged="true" debug="0"/>
>     <Context path="/admin" docBase="/opt/tomcat5/server/webapps/admin" 
> privileged="true" debug="0"/>
> </Host>
>
> The META-INF/context.xml for myapp:
>
> <Context path="" debug="5" reloadable="true" crossContext="true">
>    <Resource name="jdbc/sb_data" auth="Container" 
> type="javax.sql.DataSource"
>        maxActive="100" maxIdle="30" maxWait="10000"
>        username="XXXXX" password="XXXXX"
>        driverClassName="com.mysql.jdbc.Driver"
>        url="jdbc:mysql://localhost:3306/sb_data"/>
>    <Resource name="jdbc/sb_users" auth="Container" 
> type="javax.sql.DataSource"
>        maxActive="100" maxIdle="30" maxWait="10000"
>        username="XXXXX" password="XXXXX"
>        driverClassName="com.mysql.jdbc.Driver"
>        url="jdbc:mysql://localhost:3306/sb_users"/>
> </Context>
>
> Does anyone have any tips for how I could carry out installs of 
> myapp.war as ROOT.war and
> get it expanded?  Steps 1-4 are a little bit awkward.
>
> If I have to, I assume I could slightly streamline 1-4 by first stopping 
> the root app (/) with
> the manager, dropping in the new ROOT.war,  and then executing
>
>     jar -xf ./ROOT.war
>
> Does this expand ROOT.war exactly as Tomcat does?
>
> Thanks in advance,
> Ken Bowen
>
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.488 / Virus Database: 269.15.0/1076 - Release Date: 17-10-2007
> 19:53
>  
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.488 / Virus Database: 269.15.0/1076 - Release Date: 17-10-2007
> 19:53
>  
>
>
> ---------------------------------------------------------------------
> 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
>
>
>   

---------------------------------------------------------------------
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: Problem installing application context as ROOT

Posted by Auke Noppe <au...@gmail.com>.
Try to build your app as ROOT.war.
Because tomcat extracts the war-file, and makes some copies to tmp and work
dirs.



-----Oorspronkelijk bericht-----
Van: Ken Bowen [mailto:kbowen@als.com] 
Verzonden: donderdag 18 oktober 2007 13:43
Aan: users@tomcat.apache.org
Onderwerp: Problem installing application context as ROOT

Hi All,

I'm having a problem installing my application to run as the ROOT context.
The problem is in getting Tomcat to expand ROOT.war.

I can make things work as follows:

1. Use ant to create myapp.war, and upload it to the isp.
2. Drop myapp.war in ~tomcat5/webapps; Tomcat expands myapp.war to myapp/
3. Stop Tomcat; rename myapp/ to ROOT/, and delete myapp.war
4. Restart Tomcat;  after a delay (maybe 1-2 min), myapp is running as 
ROOT/ .

But the following doesn't work:

a. Stop Tomcat; remove everything in webapps
b. Copy myapp.war into webapps, and rename it to ~/tomcat5/webapps/ROOT.war
c. Restart Tomcat

No matter how long I wait (say 5 min),  while making requests for the
root context from a browser, ROOT.war doesn't get expanded, and all I get
in the browser is "/ is unavailable".  [In contrast, when I drop myapp.war
into webapps, it is almost instantly expanded to myapp/ ]

I've also tried starting the Tomcat manager.  It falsly claims that "/" 
is running.
I've asked it to Stop and then Start "/", but that doesn't help.

Some details:

Tomcat 5.5.25  Java 1.5.0_12

The Host spec from server.xml:

<Host appBase="webapps" name="myaddress.com" unpackWARs="true" 
autoDeploy="true">
    <Context path="/manager" 
docBase="/opt/tomcat5/server/webapps/manager" privileged="true" debug="0"/>
    <Context path="/admin" docBase="/opt/tomcat5/server/webapps/admin" 
privileged="true" debug="0"/>
</Host>

The META-INF/context.xml for myapp:

<Context path="" debug="5" reloadable="true" crossContext="true">
   <Resource name="jdbc/sb_data" auth="Container" 
type="javax.sql.DataSource"
       maxActive="100" maxIdle="30" maxWait="10000"
       username="XXXXX" password="XXXXX"
       driverClassName="com.mysql.jdbc.Driver"
       url="jdbc:mysql://localhost:3306/sb_data"/>
   <Resource name="jdbc/sb_users" auth="Container" 
type="javax.sql.DataSource"
       maxActive="100" maxIdle="30" maxWait="10000"
       username="XXXXX" password="XXXXX"
       driverClassName="com.mysql.jdbc.Driver"
       url="jdbc:mysql://localhost:3306/sb_users"/>
</Context>

Does anyone have any tips for how I could carry out installs of 
myapp.war as ROOT.war and
get it expanded?  Steps 1-4 are a little bit awkward.

If I have to, I assume I could slightly streamline 1-4 by first stopping 
the root app (/) with
the manager, dropping in the new ROOT.war,  and then executing

    jar -xf ./ROOT.war

Does this expand ROOT.war exactly as Tomcat does?

Thanks in advance,
Ken Bowen





---------------------------------------------------------------------
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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.15.0/1076 - Release Date: 17-10-2007
19:53
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.15.0/1076 - Release Date: 17-10-2007
19:53
 


---------------------------------------------------------------------
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: Problem installing application context as ROOT

Posted by Ken Bowen <kb...@als.com>.

Mark Thomas wrote:
> Ken Bowen wrote:
>   
>> The Host spec from server.xml:
>>
>> <Host appBase="webapps" name="myaddress.com" unpackWARs="true"
>> autoDeploy="true">
>>    <Context path="/manager"
>> docBase="/opt/tomcat5/server/webapps/manager" privileged="true" debug="0"/>
>>    <Context path="/admin" docBase="/opt/tomcat5/server/webapps/admin"
>> privileged="true" debug="0"/>
>> </Host>
>>     
>
> It looks like you have a third-party packaged version of Tomcat. It
> might not be the cause but you might be better off with a standard
> version downloaded from Apache or one of its mirriors.
>   
Indeed.  I don't have so much control over the system on the ISP.  
However, on my own box (Linux),
I installed a completely vanilla unzipped download from Apache.  
Everything worked exactly as
it is supposed to:  Rename myapp.war to ROOT.war, drop ROOT.war in 
webapps, and it is expanded
and the app is running as the default context.

Now to figure out how to coax the ISP into doing the right thing.... :-(

Thanks,
Ken Bowen

>   
>> The META-INF/context.xml for myapp:
>>
>> <Context path="" debug="5" reloadable="true" crossContext="true">
>>     
> Remove the path element - it isn't necessary.
>
> When cleaning things up - don't forget about $CATALINA_HOME/conf
> You might have an old context file in there confusing things.
>
> Mark
>
> ---------------------------------------------------------------------
> 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
>
>
>   

---------------------------------------------------------------------
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: Problem installing application context as ROOT

Posted by Mark Thomas <ma...@apache.org>.
Ken Bowen wrote:
> The Host spec from server.xml:
> 
> <Host appBase="webapps" name="myaddress.com" unpackWARs="true"
> autoDeploy="true">
>    <Context path="/manager"
> docBase="/opt/tomcat5/server/webapps/manager" privileged="true" debug="0"/>
>    <Context path="/admin" docBase="/opt/tomcat5/server/webapps/admin"
> privileged="true" debug="0"/>
> </Host>

It looks like you have a third-party packaged version of Tomcat. It
might not be the cause but you might be better off with a standard
version downloaded from Apache or one of its mirriors.

> The META-INF/context.xml for myapp:
> 
> <Context path="" debug="5" reloadable="true" crossContext="true">
Remove the path element - it isn't necessary.

When cleaning things up - don't forget about $CATALINA_HOME/conf
You might have an old context file in there confusing things.

Mark

---------------------------------------------------------------------
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