Props file elsewhere than in classpath

13 views
Skip to first unread message

Francois

unread,
Jul 5, 2010, 12:12:45 PM7/5/10
to lif...@googlegroups.com
Hello guys,

I would like to be able to specify the path of the directory Lift search
for propreties file, for example I would like to put them in
"/etc/myLiftApplication/".

I looked in LiftRules and Props, and didn't find a way to overload the
defaults locations (/ and /props/).

Is this something possible ?

An easy workaround is to define in props/defaults.props an unique key
with the path of the configuration file to use, but I loose all the
Props integration in Lift, so I'm wondering if there is an other way.

Thanks,

--
Francois ARMAND
http://fanf42.blogspot.com
http://www.normation.com

Timothy Perrett

unread,
Jul 5, 2010, 12:19:01 PM7/5/10
to lif...@googlegroups.com
Currently its only looking on the classpath so its not available as far as im aware. I guess we'd need to open a feature request.

TBH, i wanted to factor out the props stuff so it could use other backing stores other than properties file (such as configgy)

Cheers, Tim

> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>

Imtiaz Ahmed H E

unread,
Jul 5, 2010, 1:04:25 PM7/5/10
to lif...@googlegroups.com
I had run into this problem when integrating ostrich (e.g., at
http://github.com/robey/ostrich) along with configgy, into the Apache
incubator project ESME...finally, I read only from Props...the way it is now
in Lift...

Imtiaz

Imtiaz Ahmed Hajee Esmail
Cell +91.98452 84561
Bangalore, India

Timothy Perrett

unread,
Jul 5, 2010, 2:09:57 PM7/5/10
to lif...@googlegroups.com
But i'm sensing there is a desire from the ESME team to have something more flexible?

Cheers, Tim

in.i...@gmail.com

unread,
Jul 5, 2010, 2:43:23 PM7/5/10
to lif...@googlegroups.com
I guess that's what I meant by 'I had run into this problem'. I had certainly thought something more flexible was desirable...
Imtiaz
Sent from BlackBerry® on Airtel

Francois

unread,
Jul 6, 2010, 3:45:33 AM7/6/10
to lif...@googlegroups.com
On 05/07/2010 18:19, Timothy Perrett wrote:
> Currently its only looking on the classpath so its not available as
> far as im aware. I guess we'd need to open a feature request.
>
> TBH, i wanted to factor out the props stuff so it could use other
> backing stores other than properties file (such as configgy)

OK, thank you for the information. So I guess I'm going to avoid Props
for now, waiting for a more configurable path.

Thanks !

David Pollak

unread,
Jul 6, 2010, 9:23:32 AM7/6/10
to lif...@googlegroups.com
On Mon, Jul 5, 2010 at 9:12 AM, Francois <fan...@gmail.com> wrote:
Hello guys,

I would like to be able to specify the path of the directory Lift search for propreties file, for example I would like to put them in "/etc/myLiftApplication/".

I looked in LiftRules and Props, and didn't find a way to overload the defaults locations (/ and /props/).

Is this something possible ?

It's a boot-strapping issue.  The Props file is read very early... how do you tell your app/Lift where the props file is if it's not a well known location in the WAR?
 

An easy workaround is to define in props/defaults.props an unique key with the path of the configuration file to use, but I loose all the Props integration in Lift, so I'm wondering if there is an other way.

Thanks,

--
Francois ARMAND
http://fanf42.blogspot.com
http://www.normation.com
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Martin Ellis

unread,
Jul 6, 2010, 11:19:27 AM7/6/10
to lif...@googlegroups.com
On 6 July 2010 14:23, David Pollak <feeder.of...@gmail.com> wrote:
> It's a boot-strapping issue.  The Props file is read very early... how do
> you tell your app/Lift where the props file is if it's not a well known
> location in the WAR?

Allow it to be overridden using a deployment descriptor?
Maybe an init-param in the web.xml?

Martin

Timothy Perrett

unread,
Jul 6, 2010, 2:03:18 PM7/6/10
to lif...@googlegroups.com
No, we've been here before. That is not early enough. It would need to be some kind of system property or such -Dprops.type=whatever....

Cheers, Tim

David Pollak

unread,
Jul 6, 2010, 2:07:22 PM7/6/10
to lif...@googlegroups.com
On Tue, Jul 6, 2010 at 11:03 AM, Timothy Perrett <tim...@getintheloop.eu> wrote:
No, we've been here before. That is not early enough. It would need to be some kind of system property or such -Dprops.type=whatever....

Yeah... we can do -Dlift.props.path=/foo/bar/baz

Francois... care to open a ticket on this?
 

Cheers, Tim

On 6 Jul 2010, at 16:19, Martin Ellis wrote:

> On 6 July 2010 14:23, David Pollak <feeder.of...@gmail.com> wrote:
>> It's a boot-strapping issue.  The Props file is read very early... how do
>> you tell your app/Lift where the props file is if it's not a well known
>> location in the WAR?
>
> Allow it to be overridden using a deployment descriptor?
> Maybe an init-param in the web.xml?
>
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Jeppe Nejsum Madsen

unread,
Jul 7, 2010, 3:57:13 AM7/7/10
to lif...@googlegroups.com
On Tue, Jul 6, 2010 at 8:03 PM, Timothy Perrett <tim...@getintheloop.eu> wrote:
> No, we've been here before. That is not early enough. It would need to be some kind of system property or such -Dprops.type=whatever....

It's been a while since I looked at the boot code, but why isn't it
early enough to have a context param? I think there are a few other
issues that might confuse the issue:

- Props is in lift-util so can't rely on any servlet classes. This I
think can be worked around by having some lift internal code that sets
paths in Props when booted by a container.

- Some seem to believe that moving stuff into e.g web.xml doesn't make
a difference since this is embedded in the war anyway. But most
containers allow you to override context params from the outside.

I think the main issue is to be able to override the settings without
changing the war (e.g use the same war in different environments).

I don't think the -Dlift-props solution is the best one since this
breaks when several lift apps are deployed in the same jvm....

/Jeppe

Francois

unread,
Jul 7, 2010, 5:05:12 AM7/7/10
to lif...@googlegroups.com
On 06/07/2010 20:07, David Pollak wrote:
>
> Francois... care to open a ticket on this?

Done:
https://www.assembla.com/spaces/liftweb/tickets/571-allows-to-have-properties-configuration-files-outside-of-the-war

Reply all
Reply to author
Forward
0 new messages