Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6655

Missing FilePermission makes boot fail with NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Services
    • None
    • Repro attached

    Description

      In experimenting with DERBY-6617, I looked at the "false" returned by FileMonitor#PBInitialize, ca line 157 when the code gets a SecurityException when trying to create the derby home directory. This will happen when running with a security manager and the necessary FilePermission has not been granted to derby.jar.

      Unfortunately, this leads to the boot failing with an NPE without explanation of the cause. [The repro patch does dump the reason to the console.]

      See the repro in the attached patch derby-6617-2.diff.
      This is the stack trace seen:

      1) testMissingFilePermission(org.apache.derbyTesting.unitTests.junit.MissingPermissionsTest)java.lang.NullPointerException
      at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147)
      at java.sql.DriverManager.getConnection(DriverManager.java:664)
      at java.sql.DriverManager.getConnection(DriverManager.java:208)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:101)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:68)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:52)
      at org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection(TestConfiguration.java:1654)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.openDefaultConnection(BaseJDBCTestCase.java:553)
      at org.apache.derbyTesting.unitTests.junit.MissingPermissionsTest.testMissingFilePermission(MissingPermissionsTest.java:178)
      

      Attachments

        1. derby-6617-2.diff
          33 kB
          Dag H. Wanvik
        2. derby-6617-2.status
          2 kB
          Dag H. Wanvik

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dagw Dag H. Wanvik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: