You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim J Schumacher <Ti...@Colorado.EDU> on 2008/09/03 07:53:15 UTC

User Directories and context.xml?

Hello,

I am running suse linux, java version "1.6.0_06", tomcat 6.0.16 and I 
have the Listener for user directories configured so I can access 
webapps at eg: localhost/~myUserName.  All was working great until I 
tried to configure a jdbc data source in my public_html/META-INF 
directory....

In the tomcat documentation regarding this feature at 
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#User%20Web%20Applications 
it says:

    * Each user web application will be deployed with characteristics
      established by any DefaultContext
      <http://tomcat.apache.org/tomcat-6.0-doc/config/defaultcontext.html>
      element you have configured for this Host

My question is this:  Does this mean TC will not read a context.xml 
placed at /home/myUserName/public_html/META-INF/context.xml?  I have a 
jdbc data source configured but I cannot get it to work from the 
context.xml file located in my public_html.  It does work when I put the 
Resource in the $CATALINA_HOME/conf/context.xml. 

Thanks in advance for any help!
-Tim


---------------------------------------------------------------------
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: User Directories and context.xml?

Posted by Tim J Schumacher <Ti...@Colorado.EDU>.
Hi Chuck,

My appbase is $CATALINA_HOME/webapps

and

CATALINA_HOME=/usr/local/apache-tomcat-6.0.16

Apps running from that directory are working as expected-context.xml is 
getting processed and all is good.

The question I had was, after setting up the Listener in server.xml

        <Listener   className="org.apache.catalina.startup.UserConfig"
                    directoryName="public_html"
                    homeBase="/home"
                    
userClass="org.apache.catalina.startup.PasswdUserDatabase" />

so that any users on the system could create an app in 
/home/username/public_html everything worked as expected *except* it 
appeared that TC was not reading the public_html/META-INF/context.xml 
file.  It did read the public_html/WEB-INF/web.xml and picked up the 
classes and lib directory under public_html/WEB-INF as well.  The only 
thing it appeared not to do was read the context.xml. 

So maybe there is a context.xml somewhere else that reads and then 
ignores those?  Or is this something to do with a users public_html 
being outside the appbase?  The documentation hinted that maybe when you 
use that Listener you only get the default context (see the link in my 
first post). 

Thanks!
Tim

Caldarale, Charles R wrote:
>> From: Tim J Schumacher [mailto:Tim.Schumacher@Colorado.EDU]
>> Subject: Re: User Directories and context.xml?
>>
>> Just out of curiosity, does anyone know the motivation for not reading
>> context.xml out of a user's directory?
>>     
>
> (I apologize for coming in late on this one.)
>
> Tomcat does use context.xml out of a webapp's META-INF directory, if the file conf/Catalina/[host]/[appName].xml does not exist.  If said file does exist, the context.xml file in META-INF is ignored.
>
> What is your <Host> appBase set to?
>
> How do you deploy the webapp?
>
>  - 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
>
>   

---------------------------------------------------------------------
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: User Directories and context.xml?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tim J Schumacher [mailto:Tim.Schumacher@Colorado.EDU]
> Subject: Re: User Directories and context.xml?
>
> Just out of curiosity, does anyone know the motivation for not reading
> context.xml out of a user's directory?

(I apologize for coming in late on this one.)

Tomcat does use context.xml out of a webapp's META-INF directory, if the file conf/Catalina/[host]/[appName].xml does not exist.  If said file does exist, the context.xml file in META-INF is ignored.

What is your <Host> appBase set to?

How do you deploy the webapp?

 - 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: User Directories and context.xml?

Posted by Tim J Schumacher <Ti...@Colorado.EDU>.
Hi Paul,

Thanks for looking. 

Just out of curiosity, does anyone know the motivation for not reading 
context.xml out of a user's directory?

-Tim

Paul Pepper wrote:
> Hi Tim,
>
> You're right. Reading this:
> http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/startup/UserConfig.html
> and the doc you originally referenced, it looks as though your
> original assumption is true - I guess "characteristics established by
> any DefaultContext" would include available environment entry
> resources.
>
> Paul.
>
> 2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
>   
>> Hi Paul,
>>
>> Thanks for the reply.  I'm not sure I understand, I was thinking my user's
>> application IS public_html, are you saying i have to make a directory called
>> something like
>>
>> /home/myUserName/public_html/ROOT and move everything into there?
>> I put my WEB-INF and META-INF directly in my public_html and things in the
>> WEB-INF are getting picked up by TC (like my public_html/WEB-INF/web.xml and
>> my public_html/WEB-INF/classes, and public_html/WEB-INF/lib, etc ) but the
>> context file in public_html/META-INF/context.xml seems like it is not being
>> read by TC)
>>
>> I have treated my public_html as though it lived in
>>
>> $CATALINA_HOME/webapps/public_html
>>
>> where $CATALINA_HOME/webapps is my appbase. (I have other apps running from
>> there and they seem to work as expected)
>>
>> Is this not correct?
>>
>>
>> Other path/config info:
>>
>> My CATALINA_HOME=/usr/local/apache-tomcat-6.0.16
>>
>> and my appbase=$CATALINA_HOME/webapps, and I have some apps in there that
>> are all working fine. (with META-INF/context.xml's and jdbc working
>> properly)
>>
>> In the $CATALINA_HOME/conf/server.xml I have the Listener
>>
>>       <Listener   className="org.apache.catalina.startup.UserConfig"
>>                    directoryName="public_html"
>>                    homeBase="/home"
>>
>>  userClass="org.apache.catalina.startup.PasswdUserDatabase" />
>>
>> set up.
>>
>>
>> Thanks again - this list is very helpful!
>> -Tim
>>
>>
>>
>> Paul Pepper wrote:
>>     
>>> Tim,
>>>
>>> The META-INF/context.xml should be placed within your application's
>>> docBase. I suspect that is likely to be ~/public_html/myapp/META-INF,
>>> where ~/public_html/ is the appBase for the localhost (as you've
>>> described it) and ~/public_html/myapp is the docBase of your
>>> application.
>>>
>>> Paul.
>>>
>>> 2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
>>>
>>>       
>>>> Hello,
>>>>
>>>> I am running suse linux, java version "1.6.0_06", tomcat 6.0.16 and I
>>>> have
>>>> the Listener for user directories configured so I can access webapps at
>>>> eg:
>>>> localhost/~myUserName.  All was working great until I tried to configure
>>>> a
>>>> jdbc data source in my public_html/META-INF directory....
>>>>
>>>> In the tomcat documentation regarding this feature at
>>>>
>>>> http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#User%20Web%20Applications
>>>> it says:
>>>>
>>>>  * Each user web application will be deployed with characteristics
>>>>    established by any DefaultContext
>>>>    <http://tomcat.apache.org/tomcat-6.0-doc/config/defaultcontext.html>
>>>>    element you have configured for this Host
>>>>
>>>> My question is this:  Does this mean TC will not read a context.xml
>>>> placed
>>>> at /home/myUserName/public_html/META-INF/context.xml?  I have a jdbc data
>>>> source configured but I cannot get it to work from the context.xml file
>>>> located in my public_html.  It does work when I put the Resource in the
>>>> $CATALINA_HOME/conf/context.xml.
>>>> Thanks in advance for any help!
>>>> -Tim
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> 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
>
>   

---------------------------------------------------------------------
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: User Directories and context.xml?

Posted by Paul Pepper <si...@gmail.com>.
Hi Tim,

You're right. Reading this:
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/startup/UserConfig.html
and the doc you originally referenced, it looks as though your
original assumption is true - I guess "characteristics established by
any DefaultContext" would include available environment entry
resources.

Paul.

2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
> Hi Paul,
>
> Thanks for the reply.  I'm not sure I understand, I was thinking my user's
> application IS public_html, are you saying i have to make a directory called
> something like
>
> /home/myUserName/public_html/ROOT and move everything into there?
> I put my WEB-INF and META-INF directly in my public_html and things in the
> WEB-INF are getting picked up by TC (like my public_html/WEB-INF/web.xml and
> my public_html/WEB-INF/classes, and public_html/WEB-INF/lib, etc ) but the
> context file in public_html/META-INF/context.xml seems like it is not being
> read by TC)
>
> I have treated my public_html as though it lived in
>
> $CATALINA_HOME/webapps/public_html
>
> where $CATALINA_HOME/webapps is my appbase. (I have other apps running from
> there and they seem to work as expected)
>
> Is this not correct?
>
>
> Other path/config info:
>
> My CATALINA_HOME=/usr/local/apache-tomcat-6.0.16
>
> and my appbase=$CATALINA_HOME/webapps, and I have some apps in there that
> are all working fine. (with META-INF/context.xml's and jdbc working
> properly)
>
> In the $CATALINA_HOME/conf/server.xml I have the Listener
>
>       <Listener   className="org.apache.catalina.startup.UserConfig"
>                    directoryName="public_html"
>                    homeBase="/home"
>
>  userClass="org.apache.catalina.startup.PasswdUserDatabase" />
>
> set up.
>
>
> Thanks again - this list is very helpful!
> -Tim
>
>
>
> Paul Pepper wrote:
>>
>> Tim,
>>
>> The META-INF/context.xml should be placed within your application's
>> docBase. I suspect that is likely to be ~/public_html/myapp/META-INF,
>> where ~/public_html/ is the appBase for the localhost (as you've
>> described it) and ~/public_html/myapp is the docBase of your
>> application.
>>
>> Paul.
>>
>> 2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
>>
>>>
>>> Hello,
>>>
>>> I am running suse linux, java version "1.6.0_06", tomcat 6.0.16 and I
>>> have
>>> the Listener for user directories configured so I can access webapps at
>>> eg:
>>> localhost/~myUserName.  All was working great until I tried to configure
>>> a
>>> jdbc data source in my public_html/META-INF directory....
>>>
>>> In the tomcat documentation regarding this feature at
>>>
>>> http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#User%20Web%20Applications
>>> it says:
>>>
>>>  * Each user web application will be deployed with characteristics
>>>    established by any DefaultContext
>>>    <http://tomcat.apache.org/tomcat-6.0-doc/config/defaultcontext.html>
>>>    element you have configured for this Host
>>>
>>> My question is this:  Does this mean TC will not read a context.xml
>>> placed
>>> at /home/myUserName/public_html/META-INF/context.xml?  I have a jdbc data
>>> source configured but I cannot get it to work from the context.xml file
>>> located in my public_html.  It does work when I put the Resource in the
>>> $CATALINA_HOME/conf/context.xml.
>>> Thanks in advance for any help!
>>> -Tim
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: User Directories and context.xml?

Posted by Tim J Schumacher <Ti...@Colorado.EDU>.
Hi Paul,

Thanks for the reply.  I'm not sure I understand, I was thinking my 
user's application IS public_html, are you saying i have to make a 
directory called something like

/home/myUserName/public_html/ROOT and move everything into there? 

I put my WEB-INF and META-INF directly in my public_html and things in 
the WEB-INF are getting picked up by TC (like my 
public_html/WEB-INF/web.xml and my public_html/WEB-INF/classes, and 
public_html/WEB-INF/lib, etc ) but the context file in 
public_html/META-INF/context.xml seems like it is not being read by TC)

I have treated my public_html as though it lived in

$CATALINA_HOME/webapps/public_html

where $CATALINA_HOME/webapps is my appbase. (I have other apps running 
from there and they seem to work as expected)

Is this not correct?


Other path/config info:

My CATALINA_HOME=/usr/local/apache-tomcat-6.0.16

and my appbase=$CATALINA_HOME/webapps, and I have some apps in there 
that are all working fine. (with META-INF/context.xml's and jdbc working 
properly)

In the $CATALINA_HOME/conf/server.xml I have the Listener

        <Listener   className="org.apache.catalina.startup.UserConfig"
                     directoryName="public_html"
                     homeBase="/home"
                     
userClass="org.apache.catalina.startup.PasswdUserDatabase" />

set up. 



Thanks again - this list is very helpful!
-Tim



Paul Pepper wrote:
> Tim,
>
> The META-INF/context.xml should be placed within your application's
> docBase. I suspect that is likely to be ~/public_html/myapp/META-INF,
> where ~/public_html/ is the appBase for the localhost (as you've
> described it) and ~/public_html/myapp is the docBase of your
> application.
>
> Paul.
>
> 2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
>   
>> Hello,
>>
>> I am running suse linux, java version "1.6.0_06", tomcat 6.0.16 and I have
>> the Listener for user directories configured so I can access webapps at eg:
>> localhost/~myUserName.  All was working great until I tried to configure a
>> jdbc data source in my public_html/META-INF directory....
>>
>> In the tomcat documentation regarding this feature at
>> http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#User%20Web%20Applications
>> it says:
>>
>>   * Each user web application will be deployed with characteristics
>>     established by any DefaultContext
>>     <http://tomcat.apache.org/tomcat-6.0-doc/config/defaultcontext.html>
>>     element you have configured for this Host
>>
>> My question is this:  Does this mean TC will not read a context.xml placed
>> at /home/myUserName/public_html/META-INF/context.xml?  I have a jdbc data
>> source configured but I cannot get it to work from the context.xml file
>> located in my public_html.  It does work when I put the Resource in the
>> $CATALINA_HOME/conf/context.xml.
>> Thanks in advance for any help!
>> -Tim
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>   

---------------------------------------------------------------------
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: User Directories and context.xml?

Posted by Paul Pepper <si...@gmail.com>.
Tim,

The META-INF/context.xml should be placed within your application's
docBase. I suspect that is likely to be ~/public_html/myapp/META-INF,
where ~/public_html/ is the appBase for the localhost (as you've
described it) and ~/public_html/myapp is the docBase of your
application.

Paul.

2008/9/3 Tim J Schumacher <Ti...@colorado.edu>:
> Hello,
>
> I am running suse linux, java version "1.6.0_06", tomcat 6.0.16 and I have
> the Listener for user directories configured so I can access webapps at eg:
> localhost/~myUserName.  All was working great until I tried to configure a
> jdbc data source in my public_html/META-INF directory....
>
> In the tomcat documentation regarding this feature at
> http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#User%20Web%20Applications
> it says:
>
>   * Each user web application will be deployed with characteristics
>     established by any DefaultContext
>     <http://tomcat.apache.org/tomcat-6.0-doc/config/defaultcontext.html>
>     element you have configured for this Host
>
> My question is this:  Does this mean TC will not read a context.xml placed
> at /home/myUserName/public_html/META-INF/context.xml?  I have a jdbc data
> source configured but I cannot get it to work from the context.xml file
> located in my public_html.  It does work when I put the Resource in the
> $CATALINA_HOME/conf/context.xml.
> Thanks in advance for any help!
> -Tim
>
>
> ---------------------------------------------------------------------
> 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