Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b66
    • Fix Version/s: None
    • Component/s: rest-interface
    • Labels:
      None

      Description

      Occasionally I am seeing that between different runs of glassfish, a rest resource like http://localhost:4848/management/domain/servers/server stops working. It took me considerable time to debug and here is my finding:
      nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/resources/TemplateListOfResource.java has some code which determines what's the POST method for a resource. It goes through all methods of a config bean and finds out the command name from @Create. It is written like this:
      for (Method m : cbp.getMethods()) {
      ConfigModel.Property pp = parent.model.toProperty(m);
      if ((pp != null) && (pp.xmlName.equals(tagName)))

      { create = m.getAnnotation(Create.class); break; }

      }

      The problem is this loop can break when it should not. I see for Servers config bean, it stops iterating the moment it sees a method called getServer(). Now, there are two getServer methods in Servers class. One is annotated with @Create and the other one is not. So, depending on the order of Class.getMethods(), this method sometimes returns null. Tom corretcly pointed to me that in JDK7, Class.getMethods returns the methods in some random order that can very from run to run of the JVM even if the code hasn't changed.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Jason Lee
              Reporter:
              Sanjeeb Sahoo
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: