Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » How to configure embedded Tomcat?(How to configure settings like session-timeout?)
icon5.gif  How to configure embedded Tomcat? [message #635009] Mon, 25 October 2010 12:10 Go to next message
Daniël van 't Ooster is currently offline Daniël van 't Ooster
Messages: 2
Registered: October 2010
Junior Member
Hi all,

Is it possible to override the default web.xml which is included in the org.eclipse.gemini.web.tomcat bundle? Background of this problem is: I have a web bundle, which is deployed in Virgo. In the web.xml in this bundle, only some servlets and filters are registered. Per Virgo installation, we would like to configure things like session timeout. From the documentation (User guide, chapter 11.3) I understood this is possible to put 'Individual web applications' context configuration files' into the $SERVER_HOME/config/[enginename]/[hostname] directory.

A little unsure about how the files should be named, I created a file <server_home>/config/Catalina/localhost/web.xml, containing a copy of the defaults. This file seems to be ignored. Tried to enable some logging, but without success (is the logging eaten by the NOP SLF4J implementation?). Then I used the Process Monitor to find out which files are read, and found out it is trying to read <server_home>/conf/Catalina/localhost. A web.xml file put in here is picked up, but it creates a context named /context, but get errors printed to sysout and my configured session-timeout is ignored.

Now my question is: how should this mechanism work? Where can I put my own configuration files? Will they override the default configurations, or are they merged? It is an idea to ship (commented out) defaults with Virgo, so it is more clear what can be configured?

Re: How to configure embedded Tomcat? [message #635146 is a reply to message #635009] Mon, 25 October 2010 18:33 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Hi,

The global web.xml is placed org.eclipse.gemini.web.tomcat bundle. There you can specify settings that will be applied to all web application. For example if you put there session timeout, it will be valid for all web applications that does not specify such in their local web.xml. From the other hand if you want to specify session timeout only for your application then the correct place to do this is your local web.xml (WEB-INF/web.xml).

The context.xml is Tomcat specific and there you can configure components such as session persistence managers, Realms, and resources such as JDBC connections etc.
The context.xml for a given web application you can put in META-INF/context.xml

In your case you can specify the session timeout in the WEB-INF/web.xml

I hope this is helpful.
Best Regards,
Violeta
Re: How to configure embedded Tomcat? [message #635254 is a reply to message #635009] Tue, 26 October 2010 08:06 Go to previous messageGo to next message
Daniël van 't Ooster is currently offline Daniël van 't Ooster
Messages: 2
Registered: October 2010
Junior Member
Hi,

the point is, I cannot specify settings in the web bundle, because it is delivered to multiple customers. Some have their own requirements related to session-timeout, so for them I would like to be able to customize the web.xml. From the documentation, I read the following:

Quote:

Virgo Web Server supports standard Apache Tomcat web application context configuration. The Apache Tomcat Configuration Reference has a section on The Context Container which describes the mechanism that is used in VWS for searching context configuration files and details the context configuration properties.

The configuration files are located as follows:

$SERVER_HOME/config/context.xml is the default context configuration file for all web applications.

The $SERVER_HOME/config/[enginename]/[hostname] directory contains:

The default context configuration for all web applications of a given virtual host.

Individual web applications' context configuration files.

[enginename] is the name of Tomcat's engine ('Catalina' by default) and [hostname] names a virtual host, both of which are configured in tomcat-server.xml.



For me, it is a little bit vague what is meant by 'Individual web applications context configuration files', is it just what is mentioned in the context container section of the Tomcat documentation, or does it also include a application or server specific web.xml?

grtz,
Daniël
Re: How to configure embedded Tomcat? [message #635418 is a reply to message #635254] Tue, 26 October 2010 17:34 Go to previous message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Hi,

The section, that you quoted, handles only the context container section of the Tomcat documentation. The Virgo user documentation will be updated in a way to be more precise about different web apps configurations (the standard one - in web.xml and the Tomcat's - in context.xml).
So my recommendation is to customize the session-timeout directly either in the web app bundle (local web.xml) or in the org.eclipse.gemini.web.tomcat bundle (global web.xml)

Regards
Violeta
Previous Topic:Spring Web Services
Next Topic:deploying simple war file causes IllegalArgumentException: Required 'bundleContext' property was not
Goto Forum:
  


Current Time: Wed Sep 24 04:41:21 GMT 2014

Powered by FUDForum. Page generated in 0.06933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software