You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wojtek Kusch <w_...@t-online.de> on 2007/01/16 19:33:43 UTC

context.xml in Tomcat 6

Hi All,
in Tomcat 5.x  I had my context-file  in directory conf/catalina/localhost
and in my server.xml autoDeploy="false" deployOnStartup="false".

My context-file ((for example uleashed.xml for unleashed-web-application):

<Context path="/unleashed" docBase="unleashed" debug="1" reloadable="true">
  <Resource name="jdbc/unleashed" auth="Container" 
type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/unleashed">
    <parameter>
        <name>driverClassName</name>
         <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <parameter>
        <name>url</name>
         <value>jdbc:odbc:unleashed</value>
    </parameter>
  </ResourceParams>

</Context>



Where I can locate my context.xml in Tomcat 6.0? How does the the file look?
Thanks!
Wojtek



---------------------------------------------------------------------
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: context.xml in Tomcat 6

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wojtek Kusch [mailto:w_kusch@t-online.de] 
> Subject: Re: context.xml in Tomcat 6
> 
> If I choose this app ("unleashed") I get  - 404 _The 
> requested resource (/unleashed/) is not available.

You have no welcome file in the app's directory, nor is there any
servlet-mapping in your WEB-INF/web.xml to pass otherwise unmatched URLs
to any particular servlet.  Consequently, the request to "unleashed" is
being handled by Tomcat's DefaultServlet, which typically has directory
listings disabled, so the 404 is returned.

 - 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: context.xml in Tomcat 6

Posted by Wojtek Kusch <w_...@t-online.de>.
Thanks!
Now I get the default app.
I have my app called "unleashed" (in 
"E:/Development/Tomcat/deploy/apps"  - conform with appBase in server.xml) .
 I can find the name of this app in the "tomcat web application manager".
If I choose this app ("unleashed") I get  - 404 _The requested resource 
(/unleashed/) is not available.

_My unleashed.xml in conf/Catalina/localhost:

<Context docBase="unleashed" debug="1" reloadable="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
   prefix="localhost_unleashed_" suffix=".log"
   timestamp="false"/>

  <Resource name="jdbc/unleashed" auth="Container" 
type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/unleashed">
    <parameter>
        <name>driverClassName</name>
         <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <parameter>
        <name>url</name>
         <value>jdbc:odbc:unleashed</value>
    </parameter>
  </ResourceParams>

</Context>

Thanks, I hope you can me help again ;)




Caldarale, Charles R schrieb:
>> From: Wojtek Kusch [mailto:w_kusch@t-online.de] 
>> Subject: Re: context.xml in Tomcat 6
>>
>>  <Host name="localhost"  appBase="E:/Development/Tomcat/deploy/apps"
>>             unpackWARs="true"
>>             autoDeploy="false" deployOnStartup="false"
>>             xmlValidation="false" xmlNamespaceAware="false">
>>     
>
> The above looks fine.
>
>   
>> My manager.xml in "tomcat 6.0\conf\catalina\localhost":
>>     
>
> Again, Tomcat is case-sensitive, even if Windows isn't.  The proper name
> is "Catalina", not "catalina"; it may not make a difference in this
> particular instance, but it will in others.
>  
>   
>> <Context path="/manager" 
>>     
>
> Another again: remove the path attribute; you may not use it in Tomcat 5
> or 6 unless the <Context> element is inside server.xml, which is
> strongly discouraged.
>
>   
>> docBase="E:/Development/Tomcat/deploy/apps/manager"
>>     
>
> The above could be just "manager", since you've already specified the
> first part of the location via the <Host> appBase attribute.
>
>   
>> If I try "localhost:8080" I get a white page.
>>     
>
> You have no default application deployed, so that's expected.
>
>   
>> If i try "localhost:8080/mamager" I get a white page, too.
>>     
>
> Assuming you meant "manager", not "mamager", that's also expected, since
> the manager app has no welcome file, and you have no default app to
> display the 404 status.
>
>   
>> If i try "localhost:8080/mamager/html" I get a right page 
>> (standard page).
>>     
>
> Also as expected.
>
>   
>> I can't undestand this.... Please help!
>>     
>
> It's all working as you have specified; the primary thing you're missing
> is a default app under your appBase.  The default app location must be
> the ROOT directory or the ROOT.war file.
>
>  - 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
>
>
> __________ NOD32 1982 (20070116) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
>
>   


---------------------------------------------------------------------
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: context.xml in Tomcat 6

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wojtek Kusch [mailto:w_kusch@t-online.de] 
> Subject: Re: context.xml in Tomcat 6
> 
>  <Host name="localhost"  appBase="E:/Development/Tomcat/deploy/apps"
>             unpackWARs="true"
>             autoDeploy="false" deployOnStartup="false"
>             xmlValidation="false" xmlNamespaceAware="false">

The above looks fine.

> My manager.xml in "tomcat 6.0\conf\catalina\localhost":

Again, Tomcat is case-sensitive, even if Windows isn't.  The proper name
is "Catalina", not "catalina"; it may not make a difference in this
particular instance, but it will in others.
 
> <Context path="/manager" 

Another again: remove the path attribute; you may not use it in Tomcat 5
or 6 unless the <Context> element is inside server.xml, which is
strongly discouraged.

> docBase="E:/Development/Tomcat/deploy/apps/manager"

The above could be just "manager", since you've already specified the
first part of the location via the <Host> appBase attribute.

> If I try "localhost:8080" I get a white page.

You have no default application deployed, so that's expected.

> If i try "localhost:8080/mamager" I get a white page, too.

Assuming you meant "manager", not "mamager", that's also expected, since
the manager app has no welcome file, and you have no default app to
display the 404 status.

> If i try "localhost:8080/mamager/html" I get a right page 
> (standard page).

Also as expected.

> I can't undestand this.... Please help!

It's all working as you have specified; the primary thing you're missing
is a default app under your appBase.  The default app location must be
the ROOT directory or the ROOT.war file.

 - 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: context.xml in Tomcat 6

Posted by Wojtek Kusch <w_...@t-online.de>.
I have changed my server.xml (see appBase):

 <Host name="localhost"  appBase="E:/Development/Tomcat/deploy/apps"
            unpackWARs="true"
            autoDeploy="false" deployOnStartup="false"
            xmlValidation="false" xmlNamespaceAware="false">

 From examples I have copy >manager<-Directory to 
E:/Development/Tomcat/deploy/apps.

My manager.xml in "tomcat 6.0\conf\catalina\localhost":

<Context path="/manager" docBase="E:/Development/Tomcat/deploy/apps/manager"
        debug="0" privileged="true">

  <!-- Link to the user database we will get roles from -->
  <ResourceLink name="users" global="UserDatabase"
                type="org.apache.catalina.UserDatabase"/>

</Context>


If I try "localhost:8080" I get a white page. If i try 
"localhost:8080/mamager" I get a white page, too.
If i try "localhost:8080/mamager/html" I get a right page (standard page).

I can't undestand this.... Please help!
Wojtek









Caldarale, Charles R schrieb:
>> From: Wojtek Kusch [mailto:w_kusch@t-online.de] 
>> Subject: context.xml in Tomcat 6
>>
>> in Tomcat 5.x  I had my context-file  in directory 
>> conf/catalina/localhost
>>     
>
> The same location is also correct for Tomcat 6, except it's "Catalina",
> not "catalina" (case sensitive).
>
>   
>> <Context path="/unleashed" docBase="unleashed" debug="1" 
>>     
>
> The path attribute must not be used, since the path to the app is
> inferred from the name of the .xml file.  (This was also true in the 5.x
> levels, but 6.x may be more picky.)
>
>  - 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
>
>
> __________ NOD32 1982 (20070116) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>
>
>   


---------------------------------------------------------------------
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: context.xml in Tomcat 6

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Wojtek Kusch [mailto:w_kusch@t-online.de] 
> Subject: context.xml in Tomcat 6
> 
> in Tomcat 5.x  I had my context-file  in directory 
> conf/catalina/localhost

The same location is also correct for Tomcat 6, except it's "Catalina",
not "catalina" (case sensitive).

> <Context path="/unleashed" docBase="unleashed" debug="1" 

The path attribute must not be used, since the path to the app is
inferred from the name of the .xml file.  (This was also true in the 5.x
levels, but 6.x may be more picky.)

 - 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