glassfish
  1. glassfish
  2. GLASSFISH-2045

com.sun.appserv:type=logging advertises lock file

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.0pe
    • Component/s: logging
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      2,045

      Description

      The type=logging MBean used by AMX is producing a list of log files that include a lock file
      (server.log.lck). This should not be returned in the list of log files.

          • testing com.sun.enterprise.management.ext.logging.LoggingTest ***
            ......E.......
            Time: 0.914
            There was 1 error:
            1) testGetLogFile(com.sun.enterprise.management.ext.logging.LoggingTest)java.lang.AssertionError:
            empty contents for log file server.log.lck
            at com.sun.enterprise.management.ext.logging.LoggingTest.testGetLogFile(LoggingTest.java:195)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at com.sun.enterprise.management.TestRunner.runSuite(TestRunner.java:90)
            at com.sun.enterprise.management.TestRunner.testClass(TestRunner.java:99)
            at com.sun.enterprise.management.TestRunner.runTests(TestRunner.java:118)
            at com.sun.enterprise.management.TestRunner.runAll(TestRunner.java:320)
            at com.sun.enterprise.management.TestMain.iterateTests(TestMain.java:912)
            at com.sun.enterprise.management.TestMain.<init>(TestMain.java:874)
            at com.sun.enterprise.management.TestMain.main(TestMain.java:207)
            [java]

        Activity

        Hide
        gfbugbridge added a comment -

        <BT6512745>

        Show
        gfbugbridge added a comment - <BT6512745>
        Hide
        km added a comment -

        Logging issue.

        Show
        km added a comment - Logging issue.
        Hide
        gfbugbridge added a comment -

        <BT6543204>

        Show
        gfbugbridge added a comment - <BT6543204>
        Hide
        Nazrul added a comment -

        Assigning to correct sub-category.

        Show
        Nazrul added a comment - Assigning to correct sub-category.
        Hide
        dpatil added a comment -

        Assigning to jielin

        Show
        dpatil added a comment - Assigning to jielin
        Hide
        llc added a comment -

        The AMX Logging MBean is documented here:
        https://glassfish.dev.java.net/nonav/javaee5/amx/javadoc/com/sun/appserv/management/ext/
        logging/Logging.html

        It uses the underlying non-public com.sun.appserv:type=logging MBean. That MBean is returning non
        log files.

        Running the AMX unit tests has shown the problem, though I don't recall if it's every run that it occurs.
        See admin/mbeanapi-impl/tests/amx-unit-tests.html.

        You could try just putting a file or files that aren't log files into the log file directory (domains/
        domain1/logs). These should not be returned by the type=logging MBean. Using a tool like JConsole,
        you can invoke that MBean to see what it does.

        Analysis of the code should quickly reveal the flaw. I suspect that it just iterates all the files in a
        directory, instead of only the log files.

        Show
        llc added a comment - The AMX Logging MBean is documented here: https://glassfish.dev.java.net/nonav/javaee5/amx/javadoc/com/sun/appserv/management/ext/ logging/Logging.html It uses the underlying non-public com.sun.appserv:type=logging MBean. That MBean is returning non log files. Running the AMX unit tests has shown the problem, though I don't recall if it's every run that it occurs. See admin/mbeanapi-impl/tests/amx-unit-tests.html. You could try just putting a file or files that aren't log files into the log file directory (domains/ domain1/logs). These should not be returned by the type=logging MBean. Using a tool like JConsole, you can invoke that MBean to see what it does. Analysis of the code should quickly reveal the flaw. I suspect that it just iterates all the files in a directory, instead of only the log files.
        Hide
        jielin added a comment -

        From my understanding, the problem should be in admin management. The logging
        problem earlly means logger.

        Show
        jielin added a comment - From my understanding, the problem should be in admin management. The logging problem earlly means logger.
        Hide
        jielin added a comment -

        The problem is in com.sun.enterprise.server.logging.LogMBean.
        getArchivedLogFiles also returned .lck files. In FilenameFilterImpl class, added
        code to filter out .lck files.

        Tested with QLook and unit tests.

        Show
        jielin added a comment - The problem is in com.sun.enterprise.server.logging.LogMBean. getArchivedLogFiles also returned .lck files. In FilenameFilterImpl class, added code to filter out .lck files. Tested with QLook and unit tests.
        Hide
        jielin added a comment -

        Checked into trunck. Should be in build b45.

        Show
        jielin added a comment - Checked into trunck. Should be in build b45.

          People

          • Assignee:
            jielin
            Reporter:
            llc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: