tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Re: path to application in parallel deployment
Date Wed, 24 Aug 2011 15:06:15 GMT
On 25/08/11 12:43 AM, Christopher Schultz wrote:
> Hash: SHA1
> Aristedes,
> On 8/24/2011 10:36 AM, Aristedes Maniatis wrote:
>> On 25/08/11 12:15 AM, Christopher Schultz wrote:
>>> So, if you could do this with code it would be:
>>> getServletContext().getRealPath("/WEB-INF/classes/solr")
>>> Right?
>> Yes.
> Okay... glad I understand the goal :)
>>> There isn't any system property for this kind of thing (since
>>> system properties are JVM-wide, and not specific to any
>>> particular webapp) so it would have to be, as you say, some kind
>>> of "magic" variable that you could use.
>> Are all properties JVM-wide?
> All system properties (retrieved using System.getProperty()) are
> JVM-global.
>> If I define a property in:
>> webapps/someapp##1234/META-INF/context.xml
> Those aren't system properties -- they /will/ be local to the webapp.

Right, then theoretically at least, there could be a ${APP_ROOT} which could be available
in there so that paths within the application could be addressed. I guess this use case is
rare since code within the application is usually able to find resources on the classpath
within the application.

>>> I don't believe such a variable exists. Since Solr is servlet
>>> context-aware application (i.e. it *is* webapp), is it possible
>>> to give it a path relative to the webapp itself? You might want
>>> to ask the Solr folks about this.
>> Sure. I can try there next, but any such solution is going to
>> involve changing Solr code.
> Maybe not. Most webapp configurations assume that paths are relative
> to the webapp itself.

Our testing so far seems to suggest that it is relative to the tomcat install. But I'll follow
this up with the Solr people. Thanks for the pointer.

>>> Another option, which I think is a better option, would be to
>>> locate solr/home outside of your deployment directory.
>> That is an option, but a very awkward one since then I have an
>> application separated from the configuration which is an integral
>> part of its functionality.
> What goes in solr/home, anyway? I figured that the indexes go in
> there, not just a configuration file or two.

It contains files such as the schema definition (which is similar to a database schema definition,
only for Lucene), instructions on how to parse data sources, weightings for query facets,
etc. The actual index can be in a different path.

>> This isn't some JDBC connection which differs in every deployment,
>> but the configuration of exactly how the application works. So
>> being able to keep it in our SCM with the code and deploy together
>> is essential.
> Fair enough. I think the Solr list is the place to go. Definitely let
> us know what the answer is.

Thanks again


Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message