[MAGNOLIA-3700] Tomcat deployment / instance selection issue Created: 18/May/11  Updated: 19/May/11  Resolved: 19/May/11

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 4.4.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Tony McCrary Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: installation, instance, root, tomcat
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Apache Tomcat 6.0.18, Java 6 (1.6.0_17), Magnolia 4.4.2, Linux RHEL 2.6


Attachments: XML File ROOT.xml     File errors.log     XML File server.xml    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

I'm having an issue deploying a Magnolia application to Tomcat 6 using the ROOT.xml/ROOT webapp method.

The magnolia web application has multiple instances within it (my_site, my_site_test, author) and up until now we've had the Context configuration entered directly into the Host section of our server.xml. Our current solution works but we have a new need for automating deployments via the Tomcat manager and the use of server.xml for Contexts precludes this.

According to the Tomcat 6 documentation (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), I should be able to add a file located at $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, which in our configuration is $CATALINA_BASE/conf/my_site/x.x.x.x/ROOT.xml. Because this causes the context path to be renamed "ROOT" or "", Magnolia can't infer the correct instance from the context name itself (I believe). So I've added the following to the Context in ROOT.xml:

<Parameter name="instance" value="my_site" override="false" />

Which should cause Magnolia to choose the my_site instance. However, it doesn't appear to do so and instead I'm getting a default instance (author). Author is running on a separate tomcat instance, which is why the repository appears locked in the error log.

Thanks, please let me know if you need any more information.



 Comments   
Comment by Tony McCrary [ 18/May/11 ]

With help from Grégory Joseph, I've resolved this issue. I needed to modify the webapp's web.xml context-param as follows:

<context-param>
<param-name>magnolia.initialization.file</param-name>
<param-value>
WEB-INF/config/${servername}/${contextParam/instance}/magnolia.properties,
WEB-INF/config/${contextParam/instance}/magnolia.properties,
WEB-INF/config/${webapp}/magnolia.properties,
WEB-INF/config/${servername}/magnolia.properties,
WEB-INF/config/default/magnolia.properties
</param-value>
</context-param>

This resolved the instance selection issue.

Thanks!

Comment by Magnolia International [ 19/May/11 ]

Good to hear Cheers!

Generated at Mon Feb 12 03:48:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.