Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-12 Thread Daniel Megert
As of http://download.eclipse.org/eclipse/downloads/drops4/I20150511-2130/ 
Eclipse starts again using the latest JRE 9.

Dani



From:   Tom Schindl tom.schi...@bestsolution.at
To: equinox-dev@eclipse.org
Date:   07.05.2015 22:23
Subject:Re: [equinox-dev] Eclipse won't work on  JDK9b61 unless 
default classloader hiearchy is changed
Sent by:equinox-dev-boun...@eclipse.org



Hi,

[...]
 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. 


I don't know the inner details but if you run this app

 package samplenashornosgi;
 
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 
 import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
 
 public class Application implements IApplication {
public static class SampleObject {
public SampleObject() {
System.err.println(I am: 
 + this);
}
}
public Object start(IApplicationContext context) throws 
Exception {
System.out.println(Hello RCP World!);
 
ScriptEngineManager mgr = new 
ScriptEngineManager();
ScriptEngine engine = 
mgr.getEngineByName(nashorn);
engine.eval(var SimpleObject = 
Java.type('samplenashornosgi.Application.SampleObject'); new 
SimpleObject(););
engine.eval(var SimpleObject = 
Java.type('samplenashornosgi.Application.SampleObject'); var 
SimpleSubClass = Java.extend(SimpleObject); new SimpleSubClass() {};);
 
return IApplication.EXIT_OK;
}
 
public void stop() {
// nothing to do
}
 }

With the default setting you get:

 Hello RCP World!
 I am: samplenashornosgi.Application$SampleObject@2f8dad04
 !SESSION 2015-05-07 22:13:46.840 
---
 eclipse.buildId=unknown
 java.version=1.8.0_60-ea
 java.vendor=Oracle Corporation
 BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_DE
 Framework arguments:  -application SampleNashornOSGi.application
 Command-line arguments:  -application SampleNashornOSGi.application 
-data 
/Users/tomschindl/Documents/e-workspaces/efxclipse-ide/../runtime-SampleNashornOSGi.application
 
-dev 
file:/Users/tomschindl/Documents/e-workspaces/efxclipse-ide/.metadata/.plugins/org.eclipse.pde.core/SampleNashornOSGi.application/dev.properties
 
-os macosx -ws cocoa -arch x86_64 -consoleLog
 
 !ENTRY org.eclipse.osgi 4 0 2015-05-07 22:13:47.804
 !MESSAGE Application error
 !STACK 1
 javax.script.ScriptException: TypeError: Can not find a common class 
loader for ScriptObject and samplenashornosgi.Application.SampleObject. in 
eval at line number 1
at 
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:458)
at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:442)
at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:404)
at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:400)
at 
jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at 
javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at 
samplenashornosgi.Application.start(Application.java:24)
at 
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at 
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at 
org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
 Caused by: eval:1 TypeError: Can not find a common class

Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-07 Thread Tom Schindl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=466683

Tom

On 06.05.15 15:14, Daniel Megert wrote:
 Please open a bug to track the issues.
 
 Tom, please post the bug here.
 
 Thanks,
 Dani
 
 
 
 From:Thomas Watson tjwat...@us.ibm.com
 To:Equinox development mailing list equinox-dev@eclipse.org
 Date:05.05.2015 16:06
 Subject:Re: [equinox-dev] Eclipse won't work on  JDK9b61 unless
 default classloader hiearchy is changed
 Sent by:equinox-dev-boun...@eclipse.org
 
 
 
 
 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.
 
 Tom
 
 
 
 
 
 From:Tom Schindl tom.schi...@bestsolution.at
 To:Equinox development mailing list equinox-dev@eclipse.org,
 platform-ui-...@eclipse.org
 Date:05/05/2015 04:12 AM
 Subject:[equinox-dev] Eclipse won't work on  JDK9b61 unless
 default classloader hiearchy is changed
 Sent by:equinox-dev-boun...@eclipse.org
 
 
 
 
 Hi,
 
 Starting with b61 org.w3c.dom.** classes have been moved to
 * app classpath in b61
 * ext classpath in b62
 
 Isn't it time to throw out this none standard class lookup strategy and
 use at least ext.
 _
 __https://bugs.openjdk.java.net/browse/JDK-8042244__
 __https://bugs.openjdk.java.net/browse/JDK-8078139_
 
 Tom
 
 -- 
 Thomas Schindl, CTO
 BestSolution.at EDV Systemhaus GmbH
 Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck_
 __http://www.bestsolution.at/_
 Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
 ___
 equinox-dev mailing list
 equinox-dev@eclipse.org
 To change your delivery options, retrieve your password, or unsubscribe
 from this list, visit_
 __https://dev.eclipse.org/mailman/listinfo/equinox-dev_
 
 ___
 equinox-dev mailing list
 equinox-dev@eclipse.org
 To change your delivery options, retrieve your password, or unsubscribe
 from this list, visit
 https://dev.eclipse.org/mailman/listinfo/equinox-dev
 
 
 ___
 equinox-dev mailing list
 equinox-dev@eclipse.org
 To change your delivery options, retrieve your password, or unsubscribe from 
 this list, visit
 https://dev.eclipse.org/mailman/listinfo/equinox-dev
 


-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-07 Thread Tom Schindl
Hi,

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?

Yes

 
 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)

Tom


-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-07 Thread Thomas Watson
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?Tom-equinox-dev-boun...@eclipse.org wrote: -To: equinox-dev@eclipse.orgFrom: Tom Schindl Sent by: equinox-dev-boun...@eclipse.orgDate: 05/07/2015 02:34AMSubject: Re: [equinox-dev] Eclipse won't work on  JDK9b61 unless default classloader hiearchy is changedHi,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?Yes  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 cannot use Nashorn because its security checks are violated so one has tolaunch with ext as the classloader hierarchy.Felix for example does use the extension classloader as the default andthat's what a default java developer would expect as well (ok well hewould expect the app-classloader but he is not writing applications butbundles I think ext would be the expected classloader at least)Tom-- Thomas Schindl, CTOBestSolution.at EDV Systemhaus GmbHEduard-Bodem-Gasse 5-7, A-6020 Innsbruckhttp://www.bestsolution.at/Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck___equinox-dev mailing listequinox-dev@eclipse.orgTo change your delivery options, retrieve your password, or unsubscribe from this list, visithttps://dev.eclipse.org/mailman/listinfo/equinox-dev

___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-07 Thread Tom Schindl
Hi,

[...]
 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.  


I don't know the inner details but if you run this app

 package samplenashornosgi;
 
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 
 import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
 
 public class Application implements IApplication {
   public static class SampleObject {
   public SampleObject() {
   System.err.println(I am:  + this);
   }
   }
   public Object start(IApplicationContext context) throws Exception {
   System.out.println(Hello RCP World!);
   
   ScriptEngineManager mgr = new ScriptEngineManager();
   ScriptEngine engine = mgr.getEngineByName(nashorn);
   engine.eval(var SimpleObject = 
 Java.type('samplenashornosgi.Application.SampleObject'); new 
 SimpleObject(););
   engine.eval(var SimpleObject = 
 Java.type('samplenashornosgi.Application.SampleObject'); var SimpleSubClass = 
 Java.extend(SimpleObject); new SimpleSubClass() {};);
 
   return IApplication.EXIT_OK;
   }
 
   public void stop() {
   // nothing to do
   }
 }

With the default setting you get:

 Hello RCP World!
 I am: samplenashornosgi.Application$SampleObject@2f8dad04
 !SESSION 2015-05-07 22:13:46.840 
 ---
 eclipse.buildId=unknown
 java.version=1.8.0_60-ea
 java.vendor=Oracle Corporation
 BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=de_DE
 Framework arguments:  -application SampleNashornOSGi.application
 Command-line arguments:  -application SampleNashornOSGi.application -data 
 /Users/tomschindl/Documents/e-workspaces/efxclipse-ide/../runtime-SampleNashornOSGi.application
  -dev 
 file:/Users/tomschindl/Documents/e-workspaces/efxclipse-ide/.metadata/.plugins/org.eclipse.pde.core/SampleNashornOSGi.application/dev.properties
  -os macosx -ws cocoa -arch x86_64 -consoleLog
 
 !ENTRY org.eclipse.osgi 4 0 2015-05-07 22:13:47.804
 !MESSAGE Application error
 !STACK 1
 javax.script.ScriptException: TypeError: Can not find a common class loader 
 for ScriptObject and samplenashornosgi.Application.SampleObject. in eval at 
 line number 1
   at 
 jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:458)
   at 
 jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:442)
   at 
 jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:404)
   at 
 jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:400)
   at 
 jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
   at samplenashornosgi.Application.start(Application.java:24)
   at 
 org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
   at 
 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
   at 
 org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
   at 
 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
   at 
 org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
 Caused by: eval:1 TypeError: Can not find a common class loader for 
 ScriptObject and samplenashornosgi.Application.SampleObject.
   at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
   at 
 jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
   at 
 jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
   at 
 jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
   at 
 jdk.nashorn.internal.runtime.linker.AdaptationResult.typeError(AdaptationResult.java:70)
   at 
 jdk.nashorn.internal.runtime.linker.JavaAdapterFactory$AdapterInfo.getAdapterClass(JavaAdapterFactory.java:280)
   at 
 jdk.nashorn.internal.runtime.linker.JavaAdapterFactory.getAdapterClassFor(JavaAdapterFactory.java:131)
   at 
 

Re: [equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-05 Thread Thomas Watson
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.

Tom





From:   Tom Schindl tom.schi...@bestsolution.at
To: Equinox development mailing list equinox-dev@eclipse.org, 
platform-ui-...@eclipse.org
Date:   05/05/2015 04:12 AM
Subject:[equinox-dev] Eclipse won't work on  JDK9b61 unless 
default classloader hiearchy is changed
Sent by:equinox-dev-boun...@eclipse.org



Hi,

Starting with b61 org.w3c.dom.** classes have been moved to
* app classpath in b61
* ext classpath in b62

Isn't it time to throw out this none standard class lookup strategy and
use at least ext.

https://bugs.openjdk.java.net/browse/JDK-8042244
https://bugs.openjdk.java.net/browse/JDK-8078139

Tom

-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe 
from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

[equinox-dev] Eclipse won't work on JDK9b61 unless default classloader hiearchy is changed

2015-05-05 Thread Tom Schindl
Hi,

Starting with b61 org.w3c.dom.** classes have been moved to
* app classpath in b61
* ext classpath in b62

Isn't it time to throw out this none standard class lookup strategy and
use at least ext.

https://bugs.openjdk.java.net/browse/JDK-8042244
https://bugs.openjdk.java.net/browse/JDK-8078139

Tom

-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
___
equinox-dev mailing list
equinox-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev