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

    gadgets again - hostname issue

    corep105

      i wrote this post earlier

       

      http://community.jboss.org/message/554966#554966

       

      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: 10.0.0.8  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.

       

      Regards

      Kåre

        • 1. Re: gadgets again - hostname issue
          antoine_h

          Hi,

           

          Quite late, but yes, I confirm with GateIn 3.2.0-GA : when trying to access to the portal page, with some Gadgets in it, and with a GadgetServer that is not on the same server as the GateIn server, then I get the same kind of error.

           

          The error is comes from a connection problem, when trying to retrieve the Metadata of the Gadget, from the GadgetServer,... en ends with strange message of "Method not found" for the gadget JSON, or error when trying to render the gadget, etc...

           

          The error from the real cause (retrieve the Metadata of the Gadget) shall be thrown (or indicated with a big warn) with a better way.

           

          This seems to be on the way to be solved : see :

          Bug 824860 - Error while rendering doodle gadget when source is dead

          https://bugzilla.redhat.com/show_bug.cgi?id=824860

           

          and :

          Services management and Site Export/Import don't start

          https://issues.jboss.org/browse/GTNPORTAL-2381#comment-12716706

           

           

          Antoine

          Chercher un expert