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

org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest fails with sealing violation: package org.apache.derby.iapi.services.sanity is sealed depending on classpath order

    XMLWordPrintableJSON

    Details

    • Issue & fix info:
      Workaround attached
    • Bug behavior facts:
      Regression

      Description

      Depending on classpath order, I believe if derbyclient.jar is before derby.jar in the classpath ClassLoaderBootTest fails with a sealing violation.,

      There were 2 errors:
      1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:255)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.findDriver(EmbeddedBaseDataSource.java:366)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.getConnection(EmbeddedBaseDataSource.java:615)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.getConnection(EmbeddedBaseDataSource.java:552)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest.testBootingAnAlreadyBootedDatabase(ClassLoaderBootTest.java:178)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      Caused by: java.lang.SecurityException: sealing violation: package org.apache.derby.iapi.services.sanity is sealed
      at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:623)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:655)
      at java.net.URLClassLoader.access$400(URLClassLoader.java:92)
      at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1159)
      at java.security.AccessController.doPrivileged(AccessController.java:288)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:594)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest$DerbyURLClassLoader.loadClass(ClassLoaderBootTest.java:293)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest$DerbyURLClassLoader.loadClass(ClassLoaderBootTest.java:303)
      at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Monitor.java:365)
      at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:342)
      at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:58)
      at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:285)
      at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:67)
      at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:196)
      at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:92)
      at java.lang.J9VMInternals.initializeImpl(Native Method)
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
      ... 41 more
      2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:255)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.findDriver(EmbeddedBaseDataSource.java:366)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.getConnection(EmbeddedBaseDataSource.java:615)
      at org.apache.derby.jdbc.EmbeddedBaseDataSource.getConnection(EmbeddedBaseDataSource.java:552)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest.testBootingDatabaseShutdownByAnotherCLR(ClassLoaderBootTest.java:208)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:117)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:424)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:441)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      Caused by: java.lang.SecurityException: sealing violation: package org.apache.derby.iapi.services.sanity is sealed
      at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:623)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:655)
      at java.net.URLClassLoader.access$400(URLClassLoader.java:92)
      at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1159)
      at java.security.AccessController.doPrivileged(AccessController.java:288)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:594)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest$DerbyURLClassLoader.loadClass(ClassLoaderBootTest.java:293)
      at org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest$DerbyURLClassLoader.loadClass(ClassLoaderBootTest.java:303)
      at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Monitor.java:365)
      at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:342)
      at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:58)
      at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:285)
      at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:67)
      at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:196)
      at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:92)
      at java.lang.J9VMInternals.initializeImpl(Native Method)
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
      ... 41 more

      My classpath when this occurred was:
      .;C:/cygwin/svn/trunk/jars/sane/derbyclient.jar;C:/cygwin/svn/trunk/jars/sane/derby.jar;C:/cygwin/svn/trunk/jars/sane/de
      rbyrun.jar;C:/cygwin/svn/trunk/jars/sane/derby.jar;C:/cygwin/svn/trunk/jars/sane/derbyTesting.jar;C:/cygwin/svn/trunk/to
      ols/java/junit.jar;C:/cygwin/svn/trunk/tools/java/jakarta-oro-2.0.8.jar

      Taking out all but derbyrun.jar and derbyTesting.jar resolved the issue.

        Attachments

        1. derby-6138_diff.txt
          0.8 kB
          Katherine Marsden

          Issue Links

            Activity

              People

              • Assignee:
                kmarsden Katherine Marsden
                Reporter:
                kmarsden Katherine Marsden
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: