You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2010/05/20 12:10:54 UTC

[jira] Created: (DERBY-4669) ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath

ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath
------------------------------------------------------------------------------------

                 Key: DERBY-4669
                 URL: https://issues.apache.org/jira/browse/DERBY-4669
             Project: Derby
          Issue Type: Bug
          Components: Test
    Affects Versions: 10.7.0.0
            Reporter: Kristian Waagan
            Priority: Minor


If derbyclient.jar comes before derby.jar on the classpath, and the build is sane, the test fails.

java -cp derbyclient.jar:derby.jar:derbyTesting.jar:junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest
...
1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
        at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
        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:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        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.defineClass(URLClassLoader.java:234)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        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:369)
        at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
        at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
        at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
        at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
        at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
        at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
        ... 33 more
2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
        at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
        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:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        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.defineClass(URLClassLoader.java:234)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        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:369)
        at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
        at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
        at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
        at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
        at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
        at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
        ... 33 more


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4669) ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869565#action_12869565 ] 

Knut Anders Hatlen commented on DERBY-4669:
-------------------------------------------

I think this is because some client classes use org.apache.derby.iapi.services.sanity.SanityManager so that that class is included both in derby.jar and in derbyclient.jar. The client classes should use the SanityManager class in org.apache.derby.shared.common.sanity instead.

> ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4669
>                 URL: https://issues.apache.org/jira/browse/DERBY-4669
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>
> If derbyclient.jar comes before derby.jar on the classpath, and the build is sane, the test fails.
> java -cp derbyclient.jar:derby.jar:derbyTesting.jar:junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest
> ...
> 1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more
> 2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4669) ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869613#action_12869613 ] 

Knut Anders Hatlen commented on DERBY-4669:
-------------------------------------------

All the regression tests ran cleanly with client-imports.diff. Committed revision 946641.

> ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4669
>                 URL: https://issues.apache.org/jira/browse/DERBY-4669
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: client-imports.diff
>
>
> If derbyclient.jar comes before derby.jar on the classpath, and the build is sane, the test fails.
> java -cp derbyclient.jar:derby.jar:derbyTesting.jar:junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest
> ...
> 1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more
> 2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4669) ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4669:
--------------------------------------

    Attachment: client-imports.diff

The attached patch (client-imports.diff) makes four client classes use SanityManager from shared.common instead of iapi.services, just by changing some import statements. This change removes the org.apache.derby.iapi.services.sanity package from the sane version of derbyclient.jar.

This is however only a partial fix. ClassLoaderBootTest still fails, but now with a slightly different error message:

Caused by: java.lang.SecurityException: sealing violation: package org.apache.derby.shared.common.sanity is sealed

It looks like classes in the common.sanity package are included in both derbyclient.jar and derby.jar. I think this is because

1) Some of the engine classes use SanityManager from common instead of iapi

2) SanityManager and AssertFailure in iapi extend classes in common

> ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4669
>                 URL: https://issues.apache.org/jira/browse/DERBY-4669
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: client-imports.diff
>
>
> If derbyclient.jar comes before derby.jar on the classpath, and the build is sane, the test fails.
> java -cp derbyclient.jar:derby.jar:derbyTesting.jar:junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest
> ...
> 1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more
> 2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4669) ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869964#action_12869964 ] 

Knut Anders Hatlen commented on DERBY-4669:
-------------------------------------------

As to the engine problems, (1) should be easy to solve the same way as we did on the client. Not sure what's the best solution for (2).

I don't think it was intentional when the shared.common.sanity variant of the SanityManager was introduced, that the iapi SanityManager should depend on it and need those classes in the jar file. If I remember the discussion about sharing code between the client and the engine correctly, it was said that it was OK to avoid duplicating constants by inheriting interfaces, because references to constants in interfaces will be inlined at compile-time and not introduce run-time dependencies. Classes and methods, on the other hand, would have to be duplicated, so that mixing different versions on the classpath would not cause problems.

We could fix (2) by duplicating the code in the shared classes instead of using inheritance, and thereby making sure derby.jar doesn't contain the shared package. That would be more in line with the intention of the shared package, I believe. However, we may not be as worried about possible problems with mixed versions of debug jars as we are with insane production jars. So perhaps it would be acceptable simply to unseal the shared.common.sanity package.

> ClassLoaderBootTest fails if derbyclient.jar comes before derby.jar on the classpath
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-4669
>                 URL: https://issues.apache.org/jira/browse/DERBY-4669
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: client-imports.diff
>
>
> If derbyclient.jar comes before derby.jar on the classpath, and the build is sane, the test fails.
> java -cp derbyclient.jar:derby.jar:derbyTesting.jar:junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest
> ...
> 1) testBootingAnAlreadyBootedDatabase(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more
> 2) testBootingDatabaseShutdownByAnotherCLR(org.apache.derbyTesting.functionTests.tests.store.ClassLoaderBootTest)java.lang.ExceptionInInitializerError
>         at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(EmbeddedDataSource.java:500)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:479)
>         at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:423)
>         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:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
>         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.defineClass(URLClassLoader.java:234)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         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:369)
>         at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(BaseMonitor.java:386)
>         at org.apache.derby.impl.services.monitor.FileMonitor.<init>(FileMonitor.java:60)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Monitor.java:289)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(JDBCBoot.java:69)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(EmbeddedDriver.java:199)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(EmbeddedDriver.java:96)
>         ... 33 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.