1 Reply Latest reply on Sep 7, 2012 2:10 PM by Antoine Herzog

    gadgets again - hostname issue

    Kaare Pedersen Newbie

      i wrote this post earlier




      with an issue i thought was down to apache etc.


      I seem to have nailed it down to gatein now. If you do the following gadgets stop working:


      (1) download and extract Gatein-3.1-GA to your local pc

      (2) startup Gatein

      (3) open browser and access gatein: http://localhost:8080/portal

      (4) create a new page and add a gadget - calculator will do fine

      (5) you can now access gatein from http://localhost:8080/portal or http://<IP_NUMBER>:8080/portal or http://<HOSTNAME>:8080/portal - everything works

      (6) goto another computer - THIS IS IMPORTANT....now access portal on http://<IP_NUMBER>:8080/portal - it works

      (7) add <IP_NUMBER> to your hostfile with a name so you can do name resolution against that name eg:  MYTEST

      (8) now try http://MYTEST:8080/portal from the other pc and access the gadget. It fails casting a:


      org.json.JSONException: JSONObject["gadgets"] not found.
      <------>at org.json.JSONObject.get(JSONObject.java:422)
      <------>at org.json.JSONObject.getJSONArray(JSONObject.java:498)
      <------>at org.exoplatform.gadget.webui.component.UIGadgetPortlet.getMetadata(UIGadgetPortlet.java:101)
      <------>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      <------>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      <------>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      <------>at java.lang.reflect.Method.invoke(Method.java:597)


      (gadgets is the name of the page i created in gatein)


      One of the things that tricked me was it works on your localhost with both ip and hostname. Problem is if you want to do a standard 3-tier setup with a http server, a db server and an app server gadgets will not work because as soon as you use mod_proxy or mod_jk from the webserver to the app server gadgets stop working.


      Can anybody confirm this?


      thanks in advance.