Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Edwards, Dominic


Platform Details:
-
Tomcat 5.5.28 
Operating System: RedHat Enterprise 5


Problem
---

Tomcat appears to be mismanaging my web contexts after a restart. It happens 
only sometimes and not others.

I have the following context records in my server.xml:

Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com 
unpackWARs=true autoDeploy=true xmlValidation=false 
xmlNamespaceAware=false 

deployOnStartup=true
 Aliaswww.mysite.com/Alias
 
 Context path= reloadable=true 
docBase=/home/myaccount/public_html/mysite.com crossContext=true 
 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context

 Context path=/cms reloadable=true 
docBase=/home/myaccount/public_html/mysite.com crossContext=true
 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context
 /Host
 
This represents my website and a CMS for the website, the cms being in a 
subdirectory of the main website's root directory. Before you ask the 
configuration was originally 

designed to enable the sharing of session object data between the two contexts. 

The problem is that sometimes when Tomcat is restarted these contexts are 
confused. At other times the restart does not encounter the problem which is 
why the cause remains a 

mystery to me that I hope someone can help with.



Symptoms


If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp) 

I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

I see the main site just as I would expect so it appears sometimes both 
contexts are pointing to the same URL.




Has anyone ever experienced this kind of irregular behaviour or know what might 
be the cause? As I say this happens from time to time - sometimes and not 
others even though 

Tomcat starts up with the same configuration.

Thanks in advance.

Dominic.  



Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



Re: Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Konstantin Kolinko
2011/12/27 Edwards, Dominic dominic.edwa...@logica.com:


 Platform Details:
 -
 Tomcat 5.5.28

Old..
And 5.5.x branch as a whole is EOL in less than a year.

 Operating System: RedHat Enterprise 5


 Problem
 ---

 Tomcat appears to be mismanaging my web contexts after a restart. It happens 
 only sometimes and not others.

 I have the following context records in my server.xml:

 Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com 
 unpackWARs=true autoDeploy=true xmlValidation=false 
 xmlNamespaceAware=false

 deployOnStartup=true
         Aliaswww.mysite.com/Alias

         Context path= reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

Context elements in server.xml are explicitly discouraged. The
recommended practice is to place them into separate XML files.

         context-param
                  param-nameSharedSessiondataContext/param-name
                  param-value/cms/param-value
                /context-param
                /Context

         Context path=/cms reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

If you configure a docBase explicitly, it MUST be outside of appBase.
Your configuration is broken because of it.

         context-param
                  param-nameSharedSessiondataContext/param-name
                  param-value/cms/param-value
                /context-param
                /Context
     /Host

 This represents my website and a CMS for the website, the cms being in a 
 subdirectory of the main website's root directory. Before you ask the 
 configuration was originally

 designed to enable the sharing of session object data between the two 
 contexts.

 The problem is that sometimes when Tomcat is restarted these contexts are 
 confused. At other times the restart does not encounter the problem which is 
 why the cause remains a

 mystery to me that I hope someone can help with.



 Symptoms
 

 If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp)

 I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 I see the main site just as I would expect so it appears sometimes both 
 contexts are pointing to the same URL.




 Has anyone ever experienced this kind of irregular behaviour or know what 
 might be the cause? As I say this happens from time to time - sometimes and 
 not others even though

 Tomcat starts up with the same configuration.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Pid *
On 27 Dec 2011, at 13:19, Konstantin Kolinko knst.koli...@gmail.com wrote:

 2011/12/27 Edwards, Dominic dominic.edwa...@logica.com:


 Platform Details:
 -
 Tomcat 5.5.28

 Old..
 And 5.5.x branch as a whole is EOL in less than a year.

 Operating System: RedHat Enterprise 5


 Problem
 ---

 Tomcat appears to be mismanaging my web contexts after a restart. It happens 
 only sometimes and not others.

 I have the following context records in my server.xml:

 Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com

This appBase path, above...


 unpackWARs=true autoDeploy=true xmlValidation=false 
 xmlNamespaceAware=false

 deployOnStartup=true
 Aliaswww.mysite.com/Alias

 Context path= reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

... is the same as the docBase path, above and...



 Context elements in server.xml are explicitly discouraged. The
 recommended practice is to place them into separate XML files.

 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context

 Context path=/cms reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

... Is the same as this docBase path here too.

Is this exactly as you have it, or is it a typo?

If it is accurate it is a thoroughly broken configuration and will
mean that every directory in there is deployed as an application.


p


 If you configure a docBase explicitly, it MUST be outside of appBase.
 Your configuration is broken because of it.

 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context
 /Host

 This represents my website and a CMS for the website, the cms being in a 
 subdirectory of the main website's root directory. Before you ask the 
 configuration was originally

 designed to enable the sharing of session object data between the two 
 contexts.

 The problem is that sometimes when Tomcat is restarted these contexts are 
 confused. At other times the restart does not encounter the problem which is 
 why the cause remains a

 mystery to me that I hope someone can help with.



 Symptoms
 

 If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp)

 I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 I see the main site just as I would expect so it appears sometimes both 
 contexts are pointing to the same URL.




 Has anyone ever experienced this kind of irregular behaviour or know what 
 might be the cause? As I say this happens from time to time - sometimes and 
 not others even though

 Tomcat starts up with the same configuration.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org