Hi Alex,

See my response inline.

On 12/20/2011 05:50 PM, Alex Lopez wrote:
> Suat,
>
> I managed to deploy and use successfully the full-war into Tomcat :)
> (as you said, I had old sling and derby files lying around from
> previous version, I just missed to spot it at first. The thing is, I
> did a 'cd' into another dir from my Tomcat init script so the user dir
> was not in fact the bin folder in Tomcat.).
Glad to hear that.
>
> So now I wonder now what parameters can I pass to Tomcat to explicitly
> change the location where Sling and Derby write their things. As for
> derby, I added -Dderby.system.home=$MY_STANBOL_HOME to JAVA_OPTS and
> it gets picked up, creating factstore and derby.log. But I had no
> success changing Sling location (tried -Dsling.home=$MY_STANBOL_HOME
> without success), it still goes to the current user dir.
Yes, I also tried to set "sling.home" property manually resulting no
success. But within web.xml of full-war module, it is possible to set
sling output folder with init-param configuration as follows.

<servlet>
        <display-name>Sling Servlet</display-name>
        <servlet-name>sling</servlet-name>
       
<servlet-class>org.apache.sling.launchpad.webapp.SlingServlet</servlet-class>
*        <init-param>
          <param-name>sling.home</param-name>
          <param-value>{sling.output.path}</param-value>
        </init-param>*
        <load-on-startup>100</load-on-startup>
    </servlet>
>
> To put it another way, I would be great to be able to pass Tomcat a
> single parameter (like stanbol.dir) so it gets propagated to sling and
> derby; suppose I have been using stanbol stand-alone from location 'A'
> (where I built it), I could then just drop the war file into my
> container, setting stanbol.dir='A', and get a Stanbol instance running
> in the same state as before. I think from the use-case of integrating
> stanbol to a container as part of a webapp it makes sense to have a
> single parameter to set "stanbol home".
>
+1

@All,
To my knowledge, we may check for a property like "stanbol.dir" and
reset both "sling.home" and "derby.system.home" properties based on
"stanbol.dir" in the beginning of initialization of OSGi environment.
However, I'm not sure whether this is an elegant way to configure such
parameters or it would work at all. If you have any other idea, I would
be glad to hear them.

> Best,
> Alex
>

Best,
Suat

Reply via email to