Derby
  1. Derby
  2. DERBY-5434

On linux with IBM JDK 1.7 suites.All does not run at all failing with java.lang.reflect.InvocationTargetException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: Test
    • Labels:
      None
    • Environment:
    • Issue & fix info:
      High Value Fix
    • Bug behavior facts:
      Crash, Regression Test Failure

      Description

      On IBM 1.7, presumably after the checkin of DERBY-5363 suites.All fails to run with the exception:

      Failed to invoke class org.apache.derbyTesting.functionTests.tests.engine._Suite
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at java.lang.reflect.Method.invoke(Method.java:613)
      at org.apache.derbyTesting.functionTests.suites.AllPackages.invokeSuite(AllPackages.java:176)
      at org.apache.derbyTesting.functionTests.suites.AllPackages.suite(AllPackages.java:63)
      at org.apache.derbyTesting.functionTests.suites.All.suite(All.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at java.lang.reflect.Method.invoke(Method.java:613)
      at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:126)
      at junit.textui.TestRunner.start(TestRunner.java:184)
      at junit.textui.TestRunner.main(TestRunner.java:143)
      Caused by: junit.framework.AssertionFailedError
      at junit.framework.Assert.fail(Assert.java:47)
      at junit.framework.Assert.fail(Assert.java:53)
      at org.apache.derbyTesting.functionTests.tests.engine.RestrictiveFilePermissionsTest$2.run(RestrictiveFilePermissionsTest.java:673)
      at java.security.AccessController.doPrivileged(AccessController.java:254)
      at org.apache.derbyTesting.functionTests.tests.engine.RestrictiveFilePermissionsTest.checkAccessToOwner(RestrictiveFilePermissionsTest.java:590)
      at org.apache.derbyTesting.functionTests.tests.engine.RestrictiveFilePermissionsTest.suite(RestrictiveFilePermissionsTest.java:92)
      at org.apache.derbyTesting.functionTests.tests.engine._Suite.suite(_Suite.java:51)
      ... 14 more
      Failed to invoke suite():java.lang.reflect.InvocationTargetException

      This JDK was just released recently and I am not sure where to get it publicly. I am not sure if this is a JVM bug. I will take a look and if it is not something that can be fixed quickly, will skip this test on IBM 1.7 until we can figure it out so the other tests can run.

      1. CheckAccessToOwner.java
        12 kB
        Kathey Marsden
      2. derby-5434_disable_restrictedtest_diff.txt
        1 kB
        Kathey Marsden

        Issue Links

          Activity

          Hide
          Kathey Marsden added a comment -

          This patch removes the offending test engine.RestrictiveFilePermissiionsTest from the suite so tests will run with IBM 1.7.

          You can reproduce the problem after the patch by running just the one test.

          Show
          Kathey Marsden added a comment - This patch removes the offending test engine.RestrictiveFilePermissiionsTest from the suite so tests will run with IBM 1.7. You can reproduce the problem after the patch by running just the one test.
          Hide
          Kathey Marsden added a comment -

          Lowering the severity now that we are skipping the test.

          Show
          Kathey Marsden added a comment - Lowering the severity now that we are skipping the test.
          Hide
          Kathey Marsden added a comment -

          Attaching CheckAccessToOwner, a scaled down junit test without Derby. It passes on Windows butfails on Linux with:
          1) testCheckAccessToOwner(CheckAccessToOwner)junit.framework.AssertionFailedError
          at CheckAccessToOwner$2.run(CheckAccessToOwner.java:172)
          at java.security.AccessController.doPrivileged(AccessController.java:254)
          at CheckAccessToOwner.checkAccessToOwner(CheckAccessToOwner.java:97)
          at CheckAccessToOwner.testCheckAccessToOwner(CheckAccessToOwner.java:42)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          FAILURES!!!
          Tests run: 1, Failures: 1, Errors: 0

          I'll take a closer look tomorrow, but am not yet familiar with the new methods. Any insight is welcome.

          Show
          Kathey Marsden added a comment - Attaching CheckAccessToOwner, a scaled down junit test without Derby. It passes on Windows butfails on Linux with: 1) testCheckAccessToOwner(CheckAccessToOwner)junit.framework.AssertionFailedError at CheckAccessToOwner$2.run(CheckAccessToOwner.java:172) at java.security.AccessController.doPrivileged(AccessController.java:254) at CheckAccessToOwner.checkAccessToOwner(CheckAccessToOwner.java:97) at CheckAccessToOwner.testCheckAccessToOwner(CheckAccessToOwner.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) FAILURES!!! Tests run: 1, Failures: 1, Errors: 0 I'll take a closer look tomorrow, but am not yet familiar with the new methods. Any insight is welcome.
          Hide
          Dag H. Wanvik added a comment -

          Apparently java.nio.Files.getFileAttributeView returns null for that platform, perhaps it is not implemented for Linux (yet?).

          The test expected FileAttributeView to be available with Java 7. The engine implementation has similar code as the test. The engine, though, falls back on the Java 6 approach to set the permissions if it does not successfully execute java.nio.Files.getFileAttributeView, cf line 876 in FileUtil:

          if (view == null)

          { // ACLs not supported on this platform return false; }

          The test can't use that approach as the JDK 6 API doesn't support reading the permissions, so I guess the best solution here is to skip the test on the IBM JDK if not on Windows.

          Show
          Dag H. Wanvik added a comment - Apparently java.nio.Files.getFileAttributeView returns null for that platform, perhaps it is not implemented for Linux (yet?). The test expected FileAttributeView to be available with Java 7. The engine implementation has similar code as the test. The engine, though, falls back on the Java 6 approach to set the permissions if it does not successfully execute java.nio.Files.getFileAttributeView, cf line 876 in FileUtil: if (view == null) { // ACLs not supported on this platform return false; } The test can't use that approach as the JDK 6 API doesn't support reading the permissions , so I guess the best solution here is to skip the test on the IBM JDK if not on Windows.
          Hide
          Kathey Marsden added a comment -

          The test uses a method not available on IBM JDK 1.7. Added a change to skip the test in for this JDK.

          Show
          Kathey Marsden added a comment - The test uses a method not available on IBM JDK 1.7. Added a change to skip the test in for this JDK.
          Hide
          Knut Anders Hatlen added a comment -

          [bulk update] Close all resolved issues that haven't been updated for more than one year.

          Show
          Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development