Derby
  1. Derby
  2. DERBY-3836

On 10.4 branch JMX tests fail with security exceptions when run against classes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.4.2.0
    • Component/s: Test
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      I noticed these security exceptions running JMX tests against classes on 10.4. It runs fine with jars. There were 42 failures and all that faiiled with traces similar to the one below.

      1) testDerbyJarAttributeAlpha(org.apache.derbyTesting.functionTests.tests.management.VersionMBeanTest)javax.management.RuntimeMBeanException: java.lang.SecurityException: access denied (org.apache.derby.security.SystemPermission engine monitor)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:856)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:869)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:670)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:638)
      at org.apache.derbyTesting.functionTests.tests.management.MBeanTest$4.run(MBeanTest.java:382)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.derbyTesting.functionTests.tests.management.MBeanTest.getAttribute(MBeanTest.java:379)
      at org.apache.derbyTesting.functionTests.tests.management.MBeanTest.checkBooleanAttributeValue(MBeanTest.java:431)
      at org.apache.derbyTesting.functionTests.tests.management.VersionMBeanTest.testDerbyJarAttributeAlpha(VersionMBeanTest.java:120)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:101)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      Caused by: java.lang.SecurityException: access denied (org.apache.derby.security.SystemPermission engine monitor)
      at org.apache.derby.iapi.services.info.Version.checkMonitor(Version.java:70)
      at org.apache.derby.iapi.services.info.Version.isAlpha(Version.java:121)
      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.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
      at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
      at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
      at com.sun.jmx.mbeanserver.PerInterface.getAttribute(PerInterface.java:65)
      at com.sun.jmx.mbeanserver.MBeanSupport.getAttribute(MBeanSupport.java:216)
      at javax.management.StandardMBean.getAttribute(StandardMBean.java:358)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:666)
      ... 44 more

        Issue Links

          Activity

          Kathey Marsden created issue -
          John H. Embretsen made changes -
          Field Original Value New Value
          Assignee John H. Embretsen [ johnemb ]
          John H. Embretsen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          John H. Embretsen added a comment -

          A backport of revision 639721 from trunk seems to fix this issue:

          svn merge -r 639720:639721 https://svn.apache.org/repos/asf/db/derby/code/trunk/

          Subversion log for this revision was:

          DERBY-3558

          Add permissions to "class" portion of the derby test policy file that were
          added to the jar file section previously.

          I plan to commit/port this fix to the 10.4 branch once I have completed a couple more test runs, with and without using the classes directory.

          Show
          John H. Embretsen added a comment - A backport of revision 639721 from trunk seems to fix this issue: svn merge -r 639720:639721 https://svn.apache.org/repos/asf/db/derby/code/trunk/ Subversion log for this revision was: DERBY-3558 Add permissions to "class" portion of the derby test policy file that were added to the jar file section previously. I plan to commit/port this fix to the 10.4 branch once I have completed a couple more test runs, with and without using the classes directory.
          John H. Embretsen made changes -
          Link This issue duplicates DERBY-3558 [ DERBY-3558 ]
          Hide
          John H. Embretsen added a comment -

          Committed revision 689008 (backport of revision 639721 from trunk) to 10.4 branch.

          M java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

          suites.All ran cleanly with jars. With classes I saw re-occurrences of DERBY-3561 (testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError: expected:<2> but was:<5>), otherwise clean (JDK 1.5).
          It seems like the fix for DERBY-3561 did not include the classes domain - I believe I have a fix for that coming soon.

          Resolving this issue.

          Show
          John H. Embretsen added a comment - Committed revision 689008 (backport of revision 639721 from trunk) to 10.4 branch. M java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy suites.All ran cleanly with jars. With classes I saw re-occurrences of DERBY-3561 (testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError: expected:<2> but was:<5>), otherwise clean (JDK 1.5). It seems like the fix for DERBY-3561 did not include the classes domain - I believe I have a fix for that coming soon. Resolving this issue.
          John H. Embretsen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Derby Categories [Regression Test Failure]
          Fix Version/s 10.4.2.0 [ 12313345 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          marcos peréz made changes -
          Link This issue blocks AGILA-21 [ AGILA-21 ]
          Hide
          marcos peréz added a comment -

          www.menú.com

          Show
          marcos peréz added a comment - www.menú.com
          Gavin made changes -
          Workflow jira [ 12437195 ] Default workflow, editable Closed status [ 12799222 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          13d 17h 31m 1 John H. Embretsen 25/Aug/08 15:43
          In Progress In Progress Resolved Resolved
          18h 44m 1 John H. Embretsen 26/Aug/08 10:27
          Resolved Resolved Closed Closed
          76d 7h 32m 1 Kathey Marsden 10/Nov/08 17:00

            People

            • Assignee:
              John H. Embretsen
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development