Derby
  1. Derby
  2. DERBY-1832

sysinfo test fails with "access denied (java.util.PropertyPermission java.class.path read)" when derbyclient.jar is first in classpath

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: 10.2.1.6, 10.3.1.4
    • Component/s: Test
    • Labels:
      None
    • Urgency:
      Normal
    • Bug behavior facts:
      Regression Test Failure

      Description

      Seen on Linux and Solaris, with Sun JVM 1.4, 1.5, 1.6 when derbyclient.jar is first in classpath:

                      • Diff file derbyall/derbynetmats/DerbyNet/derbynetmats/sysinfo.diff
          • Start: sysinfo jdk1.4.2_02 DerbyNet derbynetmats:derbynetmats 2006-09-05 08:44:54 ***
            14a15
            > Unable to analyze class path: access denied (java.util.PropertyPermission java.class.path read)
            17,26d17
            < Current Locale : [English/United States [en_US]]
            < Found support for locale: [de_DE]
            < Found support for locale: [es]
            < Found support for locale: [fr]
            < Found support for locale: [it]
            < Found support for locale: [ja_JP]
            < Found support for locale: [ko_KR]
            < Found support for locale: [pt_BR]
            < Found support for locale: [zh_CN]
            < Found support for locale: [zh_TW]
            41a33
            > Unable to analyze class path: access denied (java.util.PropertyPermission java.class.path read)
            44,53d35
            < Current Locale : [English/United States [en_US]]
            < Found support for locale: [de_DE]
            < Found support for locale: [es]
            < Found support for locale: [fr]
            < Found support for locale: [it]
            < Found support for locale: [ja_JP]
            < Found support for locale: [ko_KR]
            < Found support for locale: [pt_BR]
            < Found support for locale: [zh_CN]
            < Found support for locale: [zh_TW]
            69a52
            > Unable to analyze class path: access denied (java.util.PropertyPermission java.class.path read)
            72,81d54
            < Current Locale : [English/United States [en_US]]
            < Found support for locale: [de_DE]
            < Found support for locale: [es]
            < Found support for locale: [fr]
            < Found support for locale: [it]
            < Found support for locale: [ja_JP]
            < Found support for locale: [ko_KR]
            < Found support for locale: [pt_BR]
            < Found support for locale: [zh_CN]
            < Found support for locale: [zh_TW]
            Test Failed.
          • End: sysinfo jdk1.4.2_02 DerbyNet derbynetmats:derbynetmats 2006-09-05 08:44:59 ***
      1. 1832.diff
        1 kB
        Knut Anders Hatlen
      2. 1832.stat
        0.2 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The sysinfo classes are included in derbyclient.jar. Should they be? If they should, we need to grant derbyclient.jar permission to read the classpath.

        Show
        Knut Anders Hatlen added a comment - The sysinfo classes are included in derbyclient.jar. Should they be? If they should, we need to grant derbyclient.jar permission to read the classpath.
        Hide
        Bryan Pendleton added a comment -

        The sysinfo code was recently added to derbyclient.jar. I think it was within the last 6 weeks
        or so. I searched JIRA but can't find the relevant issue, sorry, but here's a pointer to the
        discussion on derby-dev:
        http://www.nabble.com/sysinfo-in-derbyclient.jar--%28was-Re%3A-%28DERBY-1470%29-%29-tf2070540.html#a5703831

        It was an intentional change, and was done to help the scenario in which the user has only derbyclient in their classpath.

        I believe that your suggested fix (granting derbyclient.jar permission to read the classpath)
        is reasonable, and matches what we did to make these tests pass for sysinfo when run
        from derby.jar and derbytools.jar.

        Show
        Bryan Pendleton added a comment - The sysinfo code was recently added to derbyclient.jar. I think it was within the last 6 weeks or so. I searched JIRA but can't find the relevant issue, sorry, but here's a pointer to the discussion on derby-dev: http://www.nabble.com/sysinfo-in-derbyclient.jar--%28was-Re%3A-%28DERBY-1470%29-%29-tf2070540.html#a5703831 It was an intentional change, and was done to help the scenario in which the user has only derbyclient in their classpath. I believe that your suggested fix (granting derbyclient.jar permission to read the classpath) is reasonable, and matches what we did to make these tests pass for sysinfo when run from derby.jar and derbytools.jar.
        Hide
        Bryan Pendleton added a comment -

        DERBY-1470 is the relevant JIRA issue.

        Show
        Bryan Pendleton added a comment - DERBY-1470 is the relevant JIRA issue.
        Hide
        Knut Anders Hatlen added a comment -

        There are two ways to grant derbyclient.jar more access (it needs java.util.PropertyPermission and java.io.FilePermission):

        a) Adding the permissions in derby_tests.policy.
        b) Adding the permissions to sysinfo.policy and sysinfo_withproperties.policy.

        Which of them is the best way? All of these files currently contain sysinfo-specific permissions, so I'm not sure which to choose.

        Thanks.

        Show
        Knut Anders Hatlen added a comment - There are two ways to grant derbyclient.jar more access (it needs java.util.PropertyPermission and java.io.FilePermission): a) Adding the permissions in derby_tests.policy. b) Adding the permissions to sysinfo.policy and sysinfo_withproperties.policy. Which of them is the best way? All of these files currently contain sysinfo-specific permissions, so I'm not sure which to choose. Thanks.
        Hide
        Knut Anders Hatlen added a comment -

        The attached patch grants derbyclient.jar the permissions needed to run sysinfo and sysinfo_withproperties. With this patch, I have successfully run derbyall with derbyclient.jar as the first element of the classpath.

        Show
        Knut Anders Hatlen added a comment - The attached patch grants derbyclient.jar the permissions needed to run sysinfo and sysinfo_withproperties. With this patch, I have successfully run derbyall with derbyclient.jar as the first element of the classpath.
        Hide
        Bryan Pendleton added a comment -

        +1 to fixing this in the sysinfo-specific property files, as you did in 1832.diff.

        Show
        Bryan Pendleton added a comment - +1 to fixing this in the sysinfo-specific property files, as you did in 1832.diff.
        Hide
        Knut Anders Hatlen added a comment -

        Thanks Bryan!
        Committed revision 442464. Leaving the issue open until the fix has been merged to 10.2.

        Show
        Knut Anders Hatlen added a comment - Thanks Bryan! Committed revision 442464. Leaving the issue open until the fix has been merged to 10.2.
        Hide
        Andrew McIntyre added a comment -

        Marking Resolved as this has been merged to 10.2.

        Show
        Andrew McIntyre added a comment - Marking Resolved as this has been merged to 10.2.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development