Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1572

RestfulObjects viewer - Service members empty

    Details

      Description

      Sometimes the members section of the response to http://localhost:9090/restful/services/Applications/ is empty - sometimes it is not:

      {code|language=javascript}

      {
      "links" : [

      { "rel" : "self", "href" : "http://localhost:9090/restful/services/Applications", "method" : "GET", "type" : "application/json;profile=\"urn:org.restfulobjects:repr-types/object\"", "title" : "Applications" }

      ,

      { "rel" : "describedby", "href" : "http://localhost:9090/restful/domain-types/ife.dep.Applications", "method" : "GET", "type" : "application/json;profile=\"urn:org.restfulobjects:repr-types/domain-type\"" }

      ,

      { "rel" : "up", "href" : "http://localhost:9090/restful/services", "method" : "GET", "type" : "application/json;profile=\"urn:org.restfulobjects:repr-types/list\"" }

      ],
      "extensions" :

      { "oid" : "ife.dep.Applications:1", "isService" : true, "isPersistent" : true }

      ,
      "title" : "Applications",
      "serviceId" : "Applications",
      "members" : { }
      }

      
      

      After some time the app was accessed via the wicket viewer. It first delivered the homepage and then I invoked the listAll operation via the respective menu item.
      Invoking http://localhost:9090/restful/services/Applications/ afterwards showed the expected response including the members.

      In another case there was a difference between:

      In yet another case both URL's delivered a result without 'members' filled, even after the 'workaround' described above.

      https://github.com/joerg-rade/isis-app-todoapp shows the same behavior:

        Activity

        Show
        joerg.rade Jörg Rade added a comment - See eMail thread: https://lists.apache.org/api/atom.lua?mid=826e2d8ecfd4218d55e22d6e1983c52f549b5fc5dd5c1dd5ddc615f2@%3Cusers.isis.apache.org%3E
        Hide
        joerg.rade Jörg Rade added a comment - - edited

        Right now there is no difference between:

        both links show a response without members

        Show
        joerg.rade Jörg Rade added a comment - - edited Right now there is no difference between: http://localhost:9090/restful/services/Applications/ http://localhost:9090/restful/services/Applications both links show a response without members
        Hide
        joerg.rade Jörg Rade added a comment -

        The unexpected behavior occurs when:

        • org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyTrusted

        is used instead of:

        • org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth
        Show
        joerg.rade Jörg Rade added a comment - The unexpected behavior occurs when: org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyTrusted is used instead of: org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth
        Show
        joerg.rade Jörg Rade added a comment - https://mortoray.com/2014/04/09/allowing-unlimited-access-with-cors/ may shed some light.
        Hide
        danhaywood Dan Haywood added a comment -

        was thinking this might have been due to:

        isis.viewer.restfulobjects.objectPropertyValuesOnly=true

        but on closer inspection, probably not the issue that Jorg is hitting here

        Show
        danhaywood Dan Haywood added a comment - was thinking this might have been due to: isis.viewer.restfulobjects.objectPropertyValuesOnly=true but on closer inspection, probably not the issue that Jorg is hitting here
        Hide
        joerg.rade Jörg Rade added a comment -

        I suspect it's authentication / CORS related

        Show
        joerg.rade Jörg Rade added a comment - I suspect it's authentication / CORS related
        Hide
        danhaywood Dan Haywood added a comment -

        could you create an example app on github, along with a README to explain exactly how to reproduce?

        Show
        danhaywood Dan Haywood added a comment - could you create an example app on github, along with a README to explain exactly how to reproduce?
        Hide
        joerg.rade Jörg Rade added a comment - - edited

        If I recall correctly, I could reproduce it with https://github.com/joerg-rade/isis-app-todoapp

        Cheers -j
        PS: I'll add a README

        Show
        joerg.rade Jörg Rade added a comment - - edited If I recall correctly, I could reproduce it with https://github.com/joerg-rade/isis-app-todoapp Cheers -j PS: I'll add a README
        Hide
        joerg.rade Jörg Rade added a comment - - edited

        Update of the example app and README will take some more time.

        I tried setting

         isis.viewer.restfulobjects.objectPropertyValuesOnly=false 

        and it appears to have the following effect:

        On the first invocation members are empty and CrossOriginFilter is not passed - at least according to log output.
        The next invocation includes the members as expected and the CrossOrigin filter is passed with output, e.g.

        12:52:53,239  [CrossOriginFilter    qtp974747823-32 DEBUG]  Cross-origin request to /restful/services/isisApplib.ConfigurationServiceMenu is a simple cross-origin request
        12:52:53,244  [i18n                 qtp974747823-32 DEBUG]  RESTEASY002315: PathInfo: /services/isisApplib.ConfigurationServiceMenu
        

        not reproducible

        Show
        joerg.rade Jörg Rade added a comment - - edited Update of the example app and README will take some more time. I tried setting isis.viewer.restfulobjects.objectPropertyValuesOnly= false and it appears to have the following effect: On the first invocation members are empty and CrossOriginFilter is not passed - at least according to log output. The next invocation includes the members as expected and the CrossOrigin filter is passed with output, e.g. 12:52:53,239 [CrossOriginFilter qtp974747823-32 DEBUG] Cross-origin request to /restful/services/isisApplib.ConfigurationServiceMenu is a simple cross-origin request 12:52:53,244 [i18n qtp974747823-32 DEBUG] RESTEASY002315: PathInfo: /services/isisApplib.ConfigurationServiceMenu not reproducible
        Hide
        joerg.rade Jörg Rade added a comment -

        In [1] a different CORS filter and configuration (org.ebaysf.web.cors.CORSFilter) is suggested.

        Seems to solve the issue.

        [1] https://qnalist.com/questions/6453447/problems-with-isis-rest

        Show
        joerg.rade Jörg Rade added a comment - In [1] a different CORS filter and configuration (org.ebaysf.web.cors.CORSFilter) is suggested. Seems to solve the issue. [1] https://qnalist.com/questions/6453447/problems-with-isis-rest
        Show
        joerg.rade Jörg Rade added a comment - Maybe update https://github.com/danhaywood/isis-angularjs-simpleapp ?
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0b7f44552d81ac7aa0172b1c6cad6d24778db518 in isis's branch refs/heads/master from Dan Haywood
        [ https://gitbox.apache.org/repos/asf?p=isis.git;h=0b7f445 ]

        ISIS-1572: adds outline docs for MenuBarsService

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0b7f44552d81ac7aa0172b1c6cad6d24778db518 in isis's branch refs/heads/master from Dan Haywood [ https://gitbox.apache.org/repos/asf?p=isis.git;h=0b7f445 ] ISIS-1572 : adds outline docs for MenuBarsService
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0b7f44552d81ac7aa0172b1c6cad6d24778db518 in isis's branch refs/heads/dev/2.0.0/ISIS-1742-remove-deprecations from Dan Haywood
        [ https://gitbox.apache.org/repos/asf?p=isis.git;h=0b7f445 ]

        ISIS-1572: adds outline docs for MenuBarsService

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0b7f44552d81ac7aa0172b1c6cad6d24778db518 in isis's branch refs/heads/dev/2.0.0/ ISIS-1742 -remove-deprecations from Dan Haywood [ https://gitbox.apache.org/repos/asf?p=isis.git;h=0b7f445 ] ISIS-1572 : adds outline docs for MenuBarsService

          People

          • Assignee:
            Unassigned
            Reporter:
            joerg.rade Jörg Rade
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development