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 "Andrew McIntyre (JIRA)" <de...@db.apache.org> on 2006/08/16 21:12:18 UTC

[jira] Commented: (DERBY-1687) sealing violation: can't seal package org.apache.derby.iapi.services.context: already loaded with 10.2.1.0 beta

    [ http://issues.apache.org/jira/browse/DERBY-1687?page=comments#action_12428472 ] 
            
Andrew McIntyre commented on DERBY-1687:
----------------------------------------

The reason for this sealing exception is the recent inclusion of sysinfo in derbyclient.jar, the dependency chain is:

.org.apache.derby.tools.sysinfo
..org.apache.derby.impl.tools.sysinfo.Main
...org.apache.derby.iapi.services.i18n.MessageService
....org.apache.derby.iapi.services.context.ShutdownException

I thought this would have been a problem with derbynet.jar in 10.1, but it turns out that org.apache.derby.tools.sysinfo is not actually included in derbynet.jar, it runs by virtue of derby.jar being in derbynet.jar's Class-Path manifest attribute. It is not possible to run sysinfo from an isolated derbynet.jar. That's a separate issue, but may not be worth addressing, since derbynet.jar without derby.jar is not a valid runtime configuration. 

derbyclient.jar without derby.jar, though, is a valid configuration, and you wouldn't see the sealing exception if you didn't have them both on your classpath at the same time. derby.jar and derbyclient.jar on the classpath at the same time is also a valid configuration that we want to support, so I'm not sure what approach we want to take here. Also, note that i18n.MessageService catches context.ShutdownExceptions in several places, but doesn't actually do anything with them. 

So, there are a few obvious approaches: 

a) remove sysinfo from derbyclient.jar - at the cost of a supportability improvement

b) figure out a way to factor out the use of context.ShutdownException - may not be easily or cleanly doable.

c) unseal iapi.context - increased security risk?

There may be other approaches as well. At this late stage, I think I'd rather not spend too much time thinking about it and just remove sysinfo from derbyclient.jar and come up with a better solution later. Comments?

> sealing violation: can't seal package org.apache.derby.iapi.services.context: already loaded with 10.2.1.0 beta
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1687
>                 URL: http://issues.apache.org/jira/browse/DERBY-1687
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.2.0.0
>         Environment: Class path order for derby jars
> "${derby}/derbyclient.jar:${derby}/derbynet.jar:${derbytest}/derbyTesting.jar:${derby}/derbytools.jar"
>            Reporter: Daniel John Debrunner
>             Fix For: 10.2.0.0
>
>
> Downloaded db-derby-10.2.1.0-bin.zip  and hit this sealing error when running test lang/insert.sql in DerbyNetClient framework.
> Also see on the trunk with self-built jars.
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at java.lang.Class.forName1(Native Method)
>         at java.lang.Class.forName(Class.java:180)
>         at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
>         at org.apache.derby.impl.tools.ij.util.startJBMS(Unknown Source)
>         at org.apache.derby.impl.tools.ij.util.startJBMS(Unknown Source)
>         at org.apache.derby.impl.tools.ij.ConnectionEnv.init(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.initConnections(Unknown Sourc
> e)
>         at org.apache.derby.impl.tools.ij.Main.<init>(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.<init>(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.getMain(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)
> Caused by: java.lang.SecurityException: sealing violation: can't seal package or
> g.apache.derby.iapi.services.context: already loaded
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:412)
>         at java.net.URLClassLoader.access$500(URLClassLoader.java:109)
>         at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:848)
>         at java.security.AccessController.doPrivileged1(Native Method)
>         at java.security.AccessController.doPrivileged(AccessController.java:389
> )
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:371)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:572)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
>         at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown S
> ource)
>         at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
>         at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
>         at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
>         ... 13 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira