getting EXist data dir to live outside of the webapps space?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

getting EXist data dir to live outside of the webapps space?

Jeremiah Jahn-4
Is there some way get the exists db to live somewhere else in the file system?

I've done a servlet desciptor override, but because the servlet always appends conext.getRealPath to where it is looking for the config and the data dir, it always ends up looking in the extracted war. I've tried to get it to skip the configuration by pre configuring the BrokerPool, but that doesn't work either, and adds so many dependencies to my project its not worth it. I really don't want to always extract the war file and then lose my forms between runs, because it decided to extract it to some other place. 

any thoughts? Am I just missing something? My last resort is to patch exists-optional so that the servlet can use an absolute system path but that seems a little overboard. 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: getting EXist data dir to live outside of the webapps space?

Jeremiah Jahn-4
I've given up on exists for the moment, and started to use FilesystemResourceManagerFactory
for my persistence however it seems to work differently than WebAppResourceManagerFactory. If it finds a properties.xml file, then it seems to ignore all of the other properties that are in the WEB-INF resource/config dir. If I copy everything from the web dir into my filesystem dir things still break. Is there no way to blend the two together. It seem that WeResource will pull properties from any .xml file it finds while FileResource requires everything to be in a single file called properties.xml. Is this correct? Or am I just missing something?




On Sun, Aug 2, 2009 at 4:08 PM, Jeremiah Jahn <[hidden email]> wrote:
Is there some way get the exists db to live somewhere else in the file system?

I've done a servlet desciptor override, but because the servlet always appends conext.getRealPath to where it is looking for the config and the data dir, it always ends up looking in the extracted war. I've tried to get it to skip the configuration by pre configuring the BrokerPool, but that doesn't work either, and adds so many dependencies to my project its not worth it. I really don't want to always extract the war file and then lose my forms between runs, because it decided to extract it to some other place. 

any thoughts? Am I just missing something? My last resort is to patch exists-optional so that the servlet can use an absolute system path but that seems a little overboard. 





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: getting EXist data dir to live outside of the webapps space?

Jeremiah Jahn-4
I copied everything into a single properties.xml file and that seems
to have done the trick. I've added a persistence servlet to the app at
/data and in a brute force manner set the following properties:

<property as="xs:anyURI"  name="oxf.fr.persistence.app.uri.*.*.*"
value="/fr/service/delcyon"/>
<property as="xs:anyURI"
name="oxf.fr.persistence.app.uri.delcyon.*.*"
value="http://localhost:8080/orbeon/data"/>
<property as="xs:anyURI"  name="oxf.fr.persistence.app.delcyon.uri"
value="/data"/>
<property as="xs:anyURI"
name="oxf.fr.persistence.service.delcyon.uri"  value="/data"/>

nothing I do seems to cause a form I save/make in form builder to try
and save or get  the form to or from  /data. I was hoping something
would at least try to touch my servlet, when I saved. I know most of
the above are close to random flailing, but I didn't have much luck
with the examples from the form builder integration notes.

thanks again for any help


On Sun, Aug 2, 2009 at 11:08 PM, Jeremiah Jahn <[hidden email]> wrote:

>
> I've given up on exists for the moment, and started to use FilesystemResourceManagerFactory
> for my persistence however it seems to work differently than WebAppResourceManagerFactory. If it finds a properties.xml file, then it seems to ignore all of the other properties that are in the WEB-INF resource/config dir. If I copy everything from the web dir into my filesystem dir things still break. Is there no way to blend the two together. It seem that WeResource will pull properties from any .xml file it finds while FileResource requires everything to be in a single file called properties.xml. Is this correct? Or am I just missing something?
>
>
>
> On Sun, Aug 2, 2009 at 4:08 PM, Jeremiah Jahn <[hidden email]> wrote:
>>
>> Is there some way get the exists db to live somewhere else in the file system?
>> I've done a servlet desciptor override, but because the servlet always appends conext.getRealPath to where it is looking for the config and the data dir, it always ends up looking in the extracted war. I've tried to get it to skip the configuration by pre configuring the BrokerPool, but that doesn't work either, and adds so many dependencies to my project its not worth it. I really don't want to always extract the war file and then lose my forms between runs, because it decided to extract it to some other place.
>> any thoughts? Am I just missing something? My last resort is to patch exists-optional so that the servlet can use an absolute system path but that seems a little overboard.
>>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: getting EXist data dir to live outside of the webapps space?

Wouter Zelle
In reply to this post by Jeremiah Jahn-4
Hi Jeremiah,

We looked at this as well and concluded that only a relative path can be used without patching the servlet code. Using ../ you can go outside of the war, although the location remains relative to the (expanded) war location. I think the current servlet code is quite poor in this regard and we would like this to be patched (not badly enough to create a patch ourselves though). Especially since this is code from the Exist project and not from Orbeon. A good and fairly easy solution would be to allow for configs like this:

<init-param>
    <param-name>basedir</param-name>
    <param-value>${system.property.global.data.dir}/exist</param-value>
</init-param>

Then the servlet would only have to do some rather trivial parsing and can use System.getProperty("system.property.global.data.dir") + "/exist" as the absolute path.

Regards,

Wouter Zelle
IProfs BV

On Sun, Aug 2, 2009 at 23:08, Jeremiah Jahn <[hidden email]> wrote:
Is there some way get the exists db to live somewhere else in the file system?

I've done a servlet desciptor override, but because the servlet always appends conext.getRealPath to where it is looking for the config and the data dir, it always ends up looking in the extracted war. I've tried to get it to skip the configuration by pre configuring the BrokerPool, but that doesn't work either, and adds so many dependencies to my project its not worth it. I really don't want to always extract the war file and then lose my forms between runs, because it decided to extract it to some other place. 

any thoughts? Am I just missing something? My last resort is to patch exists-optional so that the servlet can use an absolute system path but that seems a little overboard. 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: getting EXist data dir to live outside of the webapps space?

Jeremiah Jahn-4
I've got a whole different database running anyway, so in the end I found it easier to just store everything in mine by changing the persistence properties. Because I'm using jetty, I couldn't even get the ../ to work as it filters it out. I ended up with 11 '../'s to get me to root, then my path to my data, but like I said Jetty killed that option for me. The way I'm handling XML is more bizarre than exists can handle anyway, so its probably for the best.

thanks for the reply,
-jj-

On Tue, Aug 4, 2009 at 2:05 AM, Wouter Zelle <[hidden email]> wrote:
Hi Jeremiah,

We looked at this as well and concluded that only a relative path can be used without patching the servlet code. Using ../ you can go outside of the war, although the location remains relative to the (expanded) war location. I think the current servlet code is quite poor in this regard and we would like this to be patched (not badly enough to create a patch ourselves though). Especially since this is code from the Exist project and not from Orbeon. A good and fairly easy solution would be to allow for configs like this:

<init-param>
    <param-name>basedir</param-name>
    <param-value>${system.property.global.data.dir}/exist</param-value>
</init-param>

Then the servlet would only have to do some rather trivial parsing and can use System.getProperty("system.property.global.data.dir") + "/exist" as the absolute path.

Regards,

Wouter Zelle
IProfs BV

On Sun, Aug 2, 2009 at 23:08, Jeremiah Jahn <[hidden email]> wrote:
Is there some way get the exists db to live somewhere else in the file system?

I've done a servlet desciptor override, but because the servlet always appends conext.getRealPath to where it is looking for the config and the data dir, it always ends up looking in the extracted war. I've tried to get it to skip the configuration by pre configuring the BrokerPool, but that doesn't work either, and adds so many dependencies to my project its not worth it. I really don't want to always extract the war file and then lose my forms between runs, because it decided to extract it to some other place. 

any thoughts? Am I just missing something? My last resort is to patch exists-optional so that the servlet can use an absolute system path but that seems a little overboard. 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: getting EXist data dir to live outside of the webapps space?

Erik Bruchez
Administrator
Jeremiah,

One possibility consists in just installing eXist separately, either
as a standalone server or at least as a separate servlet.

-Erik

On Tue, Aug 4, 2009 at 7:54 PM, Jeremiah Jahn<[hidden email]> wrote:

> I've got a whole different database running anyway, so in the end I found it
> easier to just store everything in mine by changing the persistence
> properties. Because I'm using jetty, I couldn't even get the ../ to work as
> it filters it out. I ended up with 11 '../'s to get me to root, then my path
> to my data, but like I said Jetty killed that option for me. The way I'm
> handling XML is more bizarre than exists can handle anyway,
> so its probably for the best.
> thanks for the reply,
> -jj-
>
> On Tue, Aug 4, 2009 at 2:05 AM, Wouter Zelle <[hidden email]> wrote:
>>
>> Hi Jeremiah,
>>
>> We looked at this as well and concluded that only a relative path can be
>> used without patching the servlet code. Using ../ you can go outside of the
>> war, although the location remains relative to the (expanded) war location.
>> I think the current servlet code is quite poor in this regard and we would
>> like this to be patched (not badly enough to create a patch ourselves
>> though). Especially since this is code from the Exist project and not from
>> Orbeon. A good and fairly easy solution would be to allow for configs like
>> this:
>>
>> <init-param>
>>     <param-name>basedir</param-name>
>>     <param-value>${system.property.global.data.dir}/exist</param-value>
>> </init-param>
>>
>> Then the servlet would only have to do some rather trivial parsing and can
>> use System.getProperty("system.property.global.data.dir") + "/exist" as the
>> absolute path.
>>
>> Regards,
>>
>> Wouter Zelle
>> IProfs BV
>>
>> On Sun, Aug 2, 2009 at 23:08, Jeremiah Jahn <[hidden email]> wrote:
>>>
>>> Is there some way get the exists db to live somewhere else in the file
>>> system?
>>> I've done a servlet desciptor override, but because the servlet always
>>> appends conext.getRealPath to where it is looking for the config and the
>>> data dir, it always ends up looking in the extracted war. I've tried to get
>>> it to skip the configuration by pre configuring the BrokerPool, but that
>>> doesn't work either, and adds so many dependencies to my project its not
>>> worth it. I really don't want to always extract the war file and then lose
>>> my forms between runs, because it decided to extract it to some other
>>> place.
>>> any thoughts? Am I just missing something? My last resort is to patch
>>> exists-optional so that the servlet can use an absolute system path but that
>>> seems a little overboard.
>>>
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email] mailing
>>> list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws