You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Mark Cave-Ayland <ma...@eigen.co> on 2015/06/08 15:43:06 UTC
Installing shindig-2.5.2 as non-ROOT application in Tomcat
Hi all,
I've spent a couple of hours today struggling with trying to install
shindig 2.5.2 as a non-root application and thought that I should write
a reference email for the archives in case any else finds themselves in
a similar situation.
Firstly, upon installing the application in Tomcat and launching the
commoncontainer link, I got messages in Firebug about being unable to
find pubsub-2.js, and sure enough the URL was still referencing the
Tomcat root application space.
So next I searched around the FAQ and found the link referencing running
in a non-root Tomcat application at
https://cwiki.apache.org/confluence/display/SHINDIG/Index#Index-WithTomcat,howtouseShindigasanon-rootapplication?
which led me to unpacking the WAR and altering shindig.properties as
described. Unfortunately this didn't see to make any different to the
redeployed WAR, so obviously something else was still needed.
After some more searching I came across the bug report at
https://issues.apache.org/jira/browse/SHINDIG-1654 which suggested that
I needed to alter container.js instead. But it looked like all of the
relevant URLs in container.js already had a ${CONTEXT_ROOT} included in
them.
Finally I ended up grepping the source code for pubsub-2.js and found
that that the problem was the root URL being embedded in
containers/commoncontainer/index.html like this:
<script type="text/javascript"
src="../../../gadgets/js/container:open-views:opensearch:rpc:xmlutil:pubsub-2.js?c=1&debug=1&container=default"></script>
Exploding the WAR and altering this file by hand seems to have got
everything working as it should, but I'm wondering if the correct fix
should be to move the URL to a separate .js file that can be parsed to
correctly evaluate ${CONTEXT_ROOT} at runtime? Sadly it seems that a lot
of the existing documentation regarding running shindig as a non-root
application is either obsolete or incorrect so I hope that this email
will go some way towards redressing the balance.
Kind regards,
Mark.
Re: Installing shindig-2.5.2 as non-ROOT application in Tomcat
Posted by Mark Cave-Ayland <ma...@eigen.co>.
On 10/06/15 18:11, Davies,Douglas wrote:
> I don’t think the common container has userprefs implemented. You’d need to define a user prefs function
>
> container.config_[osapi.container.ContainerConfig.SET_PREFERENCES] = function(siteId, gadgetUrl, preferences)
>
> that calls osapi.userprefs.update
>
> osapi.userprefs.update({
>
> siteId : siteId;
> data : data
>
> }).execute(function(response) {});
>
> It would be cool if a default implementation (at least in-memory) was provided.
>
> doug
Hi Doug,
Thanks for the hint. I did actually get as far as creating a dummy
GET_PREFERENCES in Javascript to return a simple JSON object which has
been enough for my testing needs so far.
I agree it would be great if commoncontainer would just work "out of the
box" for testing, but sadly I think this is outside the scope of what
shindig is trying to achieve right now.
ATB,
Mark.
Re: Installing shindig-2.5.2 as non-ROOT application in Tomcat
Posted by "Davies,Douglas" <da...@oclc.org>.
I don’t think the common container has userprefs implemented. You’d need to define a user prefs function
container.config_[osapi.container.ContainerConfig.SET_PREFERENCES] = function(siteId, gadgetUrl, preferences)
that calls osapi.userprefs.update
osapi.userprefs.update({
siteId : siteId;
data : data
}).execute(function(response) {});
It would be cool if a default implementation (at least in-memory) was provided.
doug
On Jun 8, 2015, at 11:34 AM, Mark Cave-Ayland <ma...@eigen.co>> wrote:
On 08/06/15 15:49, Ryan Baxter wrote:
Exactly Doug, it is a sample meant to run as root.
-Ryan
Ah I see. I was hoping that the commoncontainer reference implementation
would be enough to act as a local test environment for something that
will eventually be hosted elsewhere.
What's the recommended way to handle userPrefs in this case? Is it
possible to have them hosted in a simple .properties file or similar
without requiring any code modifications?
ATB,
Mark.
Re: Installing shindig-2.5.2 as non-ROOT application in Tomcat
Posted by Mark Cave-Ayland <ma...@eigen.co>.
On 08/06/15 15:49, Ryan Baxter wrote:
> Exactly Doug, it is a sample meant to run as root.
>
> -Ryan
Ah I see. I was hoping that the commoncontainer reference implementation
would be enough to act as a local test environment for something that
will eventually be hosted elsewhere.
What's the recommended way to handle userPrefs in this case? Is it
possible to have them hosted in a simple .properties file or similar
without requiring any code modifications?
ATB,
Mark.
Re: Installing shindig-2.5.2 as non-ROOT application in Tomcat
Posted by Ryan Baxter <rb...@gmail.com>.
Exactly Doug, it is a sample meant to run as root.
-Ryan
> On Jun 8, 2015, at 10:42 AM, Davies,Douglas <da...@oclc.org> wrote:
>
> Common container IMO is a reference implementation for you to build upon. We’ve written our own container that use the shindig jars (not war) and overridden anything we’ve needed to (by injecting new guice implementations or overriding javascript). I think the common container is meant to run out-of-the-box but only as root — in my experience.
>
> doug
>
>> On Jun 8, 2015, at 9:43 AM, Mark Cave-Ayland <ma...@eigen.co> wrote:
>>
>> Hi all,
>>
>> I've spent a couple of hours today struggling with trying to install
>> shindig 2.5.2 as a non-root application and thought that I should write
>> a reference email for the archives in case any else finds themselves in
>> a similar situation.
>>
>> Firstly, upon installing the application in Tomcat and launching the
>> commoncontainer link, I got messages in Firebug about being unable to
>> find pubsub-2.js, and sure enough the URL was still referencing the
>> Tomcat root application space.
>>
>> So next I searched around the FAQ and found the link referencing running
>> in a non-root Tomcat application at
>> https://cwiki.apache.org/confluence/display/SHINDIG/Index#Index-WithTomcat,howtouseShindigasanon-rootapplication?
>> which led me to unpacking the WAR and altering shindig.properties as
>> described. Unfortunately this didn't see to make any different to the
>> redeployed WAR, so obviously something else was still needed.
>>
>> After some more searching I came across the bug report at
>> https://issues.apache.org/jira/browse/SHINDIG-1654 which suggested that
>> I needed to alter container.js instead. But it looked like all of the
>> relevant URLs in container.js already had a ${CONTEXT_ROOT} included in
>> them.
>>
>> Finally I ended up grepping the source code for pubsub-2.js and found
>> that that the problem was the root URL being embedded in
>> containers/commoncontainer/index.html like this:
>>
>> <script type="text/javascript"
>> src="../../../gadgets/js/container:open-views:opensearch:rpc:xmlutil:pubsub-2.js?c=1&debug=1&container=default"></script>
>>
>> Exploding the WAR and altering this file by hand seems to have got
>> everything working as it should, but I'm wondering if the correct fix
>> should be to move the URL to a separate .js file that can be parsed to
>> correctly evaluate ${CONTEXT_ROOT} at runtime? Sadly it seems that a lot
>> of the existing documentation regarding running shindig as a non-root
>> application is either obsolete or incorrect so I hope that this email
>> will go some way towards redressing the balance.
>>
>>
>> Kind regards,
>>
>> Mark.
>
>
Re: Installing shindig-2.5.2 as non-ROOT application in Tomcat
Posted by "Davies,Douglas" <da...@oclc.org>.
Common container IMO is a reference implementation for you to build upon. We’ve written our own container that use the shindig jars (not war) and overridden anything we’ve needed to (by injecting new guice implementations or overriding javascript). I think the common container is meant to run out-of-the-box but only as root — in my experience.
doug
On Jun 8, 2015, at 9:43 AM, Mark Cave-Ayland <ma...@eigen.co> wrote:
> Hi all,
>
> I've spent a couple of hours today struggling with trying to install
> shindig 2.5.2 as a non-root application and thought that I should write
> a reference email for the archives in case any else finds themselves in
> a similar situation.
>
> Firstly, upon installing the application in Tomcat and launching the
> commoncontainer link, I got messages in Firebug about being unable to
> find pubsub-2.js, and sure enough the URL was still referencing the
> Tomcat root application space.
>
> So next I searched around the FAQ and found the link referencing running
> in a non-root Tomcat application at
> https://cwiki.apache.org/confluence/display/SHINDIG/Index#Index-WithTomcat,howtouseShindigasanon-rootapplication?
> which led me to unpacking the WAR and altering shindig.properties as
> described. Unfortunately this didn't see to make any different to the
> redeployed WAR, so obviously something else was still needed.
>
> After some more searching I came across the bug report at
> https://issues.apache.org/jira/browse/SHINDIG-1654 which suggested that
> I needed to alter container.js instead. But it looked like all of the
> relevant URLs in container.js already had a ${CONTEXT_ROOT} included in
> them.
>
> Finally I ended up grepping the source code for pubsub-2.js and found
> that that the problem was the root URL being embedded in
> containers/commoncontainer/index.html like this:
>
> <script type="text/javascript"
> src="../../../gadgets/js/container:open-views:opensearch:rpc:xmlutil:pubsub-2.js?c=1&debug=1&container=default"></script>
>
> Exploding the WAR and altering this file by hand seems to have got
> everything working as it should, but I'm wondering if the correct fix
> should be to move the URL to a separate .js file that can be parsed to
> correctly evaluate ${CONTEXT_ROOT} at runtime? Sadly it seems that a lot
> of the existing documentation regarding running shindig as a non-root
> application is either obsolete or incorrect so I hope that this email
> will go some way towards redressing the balance.
>
>
> Kind regards,
>
> Mark.