Shindig
  1. Shindig
  2. SHINDIG-272

Hard coded paths cause problems when deploying shindig to Java EE container

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: Javascript
    • Labels:
      None

      Description

      In the interest of making Shindig easier for people deploying to servers outside just running from Jetty, I came across some hard code path issues in the samplecontainer.
      Currently if I take the generated war file in java/server/target: shindig-server-1-SNAPSHOT.war and deploy it to a Java EE container like tomcat or Glassfish, I'm not able to get the samplecontainer and social data stuff running very easily.

      • For example to deploy to tomcat, I rename the war file to shindig.war and toss in the webapps directory. I should be able to go to host:port/shindig/gadgets/files/samplecontainer/samplecontainer.html and see the app running.

      Currently I have to do the following to get it close:
      1. Edit the config/container.js and add "/shindig" to opensocial path:
      "opensocial-0.7" : {
      // Path to fetch opensocial data from
      // Must be on the same domain as the gadget rendering server
      "path" : "/shindig/social/data",

      2. I have to edit the "socialDataPath" in the SampleContainer.html to include "shindig".
      var socialDataPath = document.location.protocol + "//" + document.location.host
      + "/shindig/social/data";

      3. I also see that when I do these updates, I still see a problem rendering the gadget. The SocialHelloWorld gadget no longer dynamically adjusts for height.

      Here's what I'd recommend:

      • Instead of generating shindig-server-1-SNAPSHOT.war - let's just call it shindig.war. That way you don't have to always rename it.
      • Remove the need to have to edit the path to the social data in the config. We should be hopefully be able to determine this automatically.
      • For the SampleContainer.html, I would deduce the correct path to social data as well so it's not hard coded either.

      Also the dynamic height issue is troublesome. I'm sure it's related though.

      Additionally it would be really nice to just go to: host:port/shindig and see a nice home page for Shindig - maybe a separate issue.

        Issue Links

          Activity

          Hide
          Henning Schmiedehausen added a comment -

          I usually deploy it as ROOT.war to a tomcat (running as the root application) and that worked reasonably well.

          Show
          Henning Schmiedehausen added a comment - I usually deploy it as ROOT.war to a tomcat (running as the root application) and that worked reasonably well.
          Hide
          Anthony Lai added a comment -

          I happened to try and deploy Shindig to Tomcat under a context other than ROOT, and I encountered the exact same issues. A reason for putting it in a separate context, which I think it is valid, is that we do have our main application sitting on top of the ROOT context, and there does not seem to be any reason for the need to merge shindig with our main application for things to work correctly. Separate them in 2 different repository and war files look cleaner at least.

          This issue is holding us up on deploying opensocial to our site. Any pointers would be greatly appreciated.

          Show
          Anthony Lai added a comment - I happened to try and deploy Shindig to Tomcat under a context other than ROOT, and I encountered the exact same issues. A reason for putting it in a separate context, which I think it is valid, is that we do have our main application sitting on top of the ROOT context, and there does not seem to be any reason for the need to merge shindig with our main application for things to work correctly. Separate them in 2 different repository and war files look cleaner at least. This issue is holding us up on deploying opensocial to our site. Any pointers would be greatly appreciated.
          Hide
          Vaclav Tolar added a comment -

          I have also problem with this. If Shindig is deployed on other than ROOT context rpc feature does not work. I have observed it at pubsub sample. Actually, point 3 from description is also based on rpc.

          Show
          Vaclav Tolar added a comment - I have also problem with this. If Shindig is deployed on other than ROOT context rpc feature does not work. I have observed it at pubsub sample. Actually, point 3 from description is also based on rpc.
          Hide
          impetus technologies added a comment -

          Same problem comes with PHP Shindig if Virtualhost is not used. To run PHP Shindig in that case I have to add the "web_prefix " value in config/container.js like

          "path" : "/shindig/php/social"

          Show
          impetus technologies added a comment - Same problem comes with PHP Shindig if Virtualhost is not used. To run PHP Shindig in that case I have to add the "web_prefix " value in config/container.js like "path" : "/shindig/php/social"
          Hide
          Paul Payne added a comment - - edited

          I have resolved this issue locally. This will work for Linux and/or Mac OS X users:

          1) I renamed the .war opensocial and placed into the Tomcat /webapps directory

          2) Add the following to /etc/hosts:

          127.0.0.1 opensocial.localhost

          3) Created the following Host configuration in Tomcat. (replace TOMCAT_HOME with respective directory)

          <Host name="opensocial.localhost" debug="1"
          appBase="

          {TOMCAT_HOME}

          /webapps/opensocial"
          autoDeploy="false"
          deployOnStartup="false"
          useNaming="true"
          unpackWARs="true">

          <Context path="" useNaming="true" docBase="" debug="1" reloadable="true" />
          </Host>

          4) Now all samples should work by using the new local host name:

          http://opensocial.localhost:8080/gadgets/files/samplecontainer/samplecontainer.html

          Show
          Paul Payne added a comment - - edited I have resolved this issue locally. This will work for Linux and/or Mac OS X users: 1) I renamed the .war opensocial and placed into the Tomcat /webapps directory 2) Add the following to /etc/hosts: 127.0.0.1 opensocial.localhost 3) Created the following Host configuration in Tomcat. (replace TOMCAT_HOME with respective directory) <Host name="opensocial.localhost" debug="1" appBase=" {TOMCAT_HOME} /webapps/opensocial" autoDeploy="false" deployOnStartup="false" useNaming="true" unpackWARs="true"> <Context path="" useNaming="true" docBase="" debug="1" reloadable="true" /> </Host> 4) Now all samples should work by using the new local host name: http://opensocial.localhost:8080/gadgets/files/samplecontainer/samplecontainer.html
          Hide
          Ryan Baxter added a comment -

          Has there been anymore progress on this issue? Any chance it will be fixed in the next release?

          Show
          Ryan Baxter added a comment - Has there been anymore progress on this issue? Any chance it will be fixed in the next release?
          Hide
          Henry Saputra added a comment -

          I think this is addressed with SHINDIG-1525

          Show
          Henry Saputra added a comment - I think this is addressed with SHINDIG-1525

            People

            • Assignee:
              Unassigned
              Reporter:
              Chris Schalk
            • Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development