[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Eclipse won't work on > JDK9b61 unless default classloader hiearchy is changed

I think you miss-interpret what I am saying.  The framework, Equinox or Felix have no control over what class loader is used to load the framework implementation.  That is up to the launcher.  Forever the Eclipse launcher has set the default parent class loader of the class loader used to load the framework to the boot class loader.  This means the framework implementation only has access to the packages from the boot class loader and therefore can only export packages available on the boot class path.  Now in Java 9 the strange decision has been made to move packages to the extension class loader that used to always be on the boot class loader.  So this means with the default configuration of the Eclipse launcher the framework itself will not have access to certain packages so it will not be able to export these packages to make them available to the other bundle class loaders.  That is the issue with the framework parent class loader.  That is something I agree we likely need to change to be the extension class loader now.  Again, this is not a framework implementation change, but instead an Eclipse launcher change.

But you mention that using the boot class loader as the parent class loader for bundle class loaders causes problems for Nashorn.  I fail to see why that is.  The parent class loader for bundles class loaders should only ever be used to delegate packages java.*.  NO other packages should ever delegate to the parent class loader of bundle class loaders.  OSGi by default only delegates to the bundle class loader parent for java.* packages and packages configured into the bootdelegation configuration property.  It is a horrible practice to depend on bootdelegation for anything other than java.*  All other package dependencies should be expressed by using a declared dependency (Import-Package, Require-Bundle).  This cause delegation to the proper exporter of the package, which may be the system bundle.  Can you go into more details on why you think we must change the parent class loader of bundle class loaders?


-----equinox-dev-bounces@xxxxxxxxxxx wrote: -----
To: equinox-dev@xxxxxxxxxxx
From: Tom Schindl
Sent by: equinox-dev-bounces@xxxxxxxxxxx
Date: 05/07/2015 02:34AM
Subject: Re: [equinox-dev] Eclipse won't work on > JDK9b61 unless default classloader hiearchy is changed


On 05.05.15 16:05, Thomas Watson wrote:
> Please open a bug to track the issues.  I assume you are having to set
> the configuration property osgi.frameworkParentClassloader=ext to get
> this to work on Java 9?


> I still believe the default 'parent' class loader for bundles should be
> 'boot', but the class loader used to load up the framework a therefore
> allow the framework to export the packages from ext can probably change.

Why should it be boot? Even in Java8 this causes troubles and eg one can
not use Nashorn because its security checks are violated so one has to
launch with ext as the classloader hierarchy.

Felix for example does use the extension classloader as the default and
that's what a default java developer would expect as well (ok well he
would expect the app-classloader but he is not writing applications but
bundles I think ext would be the expected classloader at least)


Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
equinox-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit