Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Error when trying to inspect e4 apps with Scenic View
Error when trying to inspect e4 apps with Scenic View [message #1836526] Wed, 06 January 2021 21:54 Go to next message
Stéphane  ournier is currently offline Stéphane ournierFriend
Messages: 313
Registered: July 2009
Senior Member
Hi,

Happy New Year e(fx)clipse community :-)

I have an e4 rcp app based on efx running with AdoptOpenJDK 15 + OpenJFX 15.
In my product file I have this to make it run smoothly:
-Dosgi.framework.extensions=org.eclipse.fx.osgi
-Defxclipse.java-modules.dir=/path/to/javafx-sdk-15.0.1/lib

In parallel, I run ScenicView (v11.0.2) from a terminal with this command:
java --module-path /path/to/javafx-sdk-15.0.1/lib --add-modules javafx.controls,javafx.web,javafx.fxml,javafx.swing -jar scenicview.jar

When ScenicView detects my e4 rcp app, in the traces of my app I got some ClassNotFoundException against JavaFX classes (see below ***).

I tried to add, as default VM args, --module-path and --add-modules directives, but it still fails with other errors and the e4 app is no longer launching.

Does anyone have an idea or experience with e4 RCP with JFX11 and Scenic View please ?

***:
Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535)
Caused by: java.lang.NoClassDefFoundError: javafx/collections/ListChangeListener
at org.fxconnector.remote.RuntimeAttach.init(RuntimeAttach.java:85)
at org.fxconnector.remote.RuntimeAttach.agentmain(RuntimeAttach.java:58)
... 6 more
Caused by: java.lang.ClassNotFoundException: javafx.collections.ListChangeListener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 8 more
Agent failed to start!

Re: Error when trying to inspect e4 apps with Scenic View [message #1836743 is a reply to message #1836526] Wed, 13 January 2021 09:40 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6580
Registered: July 2009
Senior Member
well the problem is that ScenicView is trying to load stuff through the Systemclassloader which can not work as those are loaded in an extra JPMS-Layer and each layer has to have a distinct classloader. So you have 2 options:
* Use something like ZuluFX which includes JavaFX as part of the System-Modules
* Do not launch ScenicView as an external application but wrap it as an OSGi-Module and create an instance as part of your OSGi-Application
Re: Error when trying to inspect e4 apps with Scenic View [message #1836783 is a reply to message #1836743] Wed, 13 January 2021 19:56 Go to previous messageGo to next message
Stéphane  ournier is currently offline Stéphane ournierFriend
Messages: 313
Registered: July 2009
Senior Member
Hi Tom,
I will make a try to your second suggestion.

Thanks for the tip,
Stéphane
Re: Error when trying to inspect e4 apps with Scenic View [message #1837086 is a reply to message #1836743] Thu, 21 January 2021 20:23 Go to previous message
Stéphane  ournier is currently offline Stéphane ournierFriend
Messages: 313
Registered: July 2009
Senior Member
Hi Tom,
I made a try to your suggestion to run with ZuluFX "the quickest" option.
it solved the connection between ScenicView but I get theses exceptions in my e4 JavaFX app even if the application seems running normally:

I tried to pass some --add-opens or --add-exports without success.

Do you have an idea of the correct line to passe to make it run without such ugly exceptions please ?


java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.eclipse.fx.osgi.fxloader.jpms.ModuleLayerWrapper$ControllerWrapper.addExports(ModuleLayerWrapper.java:173)
at org.eclipse.fx.osgi.fxloader.jpms.JavaModuleLayerModification.applyConfigurations(JavaModuleLayerModification.java:110)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.advancedModuleLayerBoostrap(FXClassLoader.java:483)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.initModuleLayer(FXClassLoader.java:426)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.getModuleLayer(FXClassLoader.java:293)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.findClassJavaFX11(FXClassLoader.java:207)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.postFindClass(FXClassLoader.java:144)
at org.eclipse.osgi.internal.loader.BundleLoader.searchHooks(BundleLoader.java:530)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:493)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.desktop/com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:103)
at java.desktop/com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:94)
at java.desktop/com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
at java.desktop/com.sun.beans.finder.BeanInfoFinder.find(BeanInfoFinder.java:41)
at java.desktop/java.beans.Introspector.findExplicitBeanInfo(Introspector.java:484)
at java.desktop/java.beans.Introspector.<init>(Introspector.java:434)
at java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:205)
at org.apache.log4j.config.PropertySetter.introspect(PropertySetter.java:76)
at org.apache.log4j.config.PropertySetter.getPropertyDescriptor(PropertySetter.java:244)
at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:156)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:130)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:684)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:334)
at org.apache.log4j.PropertyWatchdog.doOnChange(PropertyConfigurator.java:717)
at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
at org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:709)
at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:400)
at com.tus.core.runtime.log4j.Log4JConfigurator.configure(Log4JConfigurator.java:97)
at com.tus.core.runtime.log4j.Log4JConfigurator.configureFromClassPath(Log4JConfigurator.java:140)
at com.tus.core.runtime.initialiser.internal.Log4jInitialiser.initialise(Log4jInitialiser.java:34)
at com.tus.core.runtime.initialiser.InitialiserActivator.lambda$0(InitialiserActivator.java:23)
at com.tus.core.runtime.osgi.Service.lambda$2(Service.java:116)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.tus.core.runtime.osgi.Service.create(Service.java:189)
at com.tus.core.runtime.initialiser.InitialiserActivator.start(InitialiserActivator.java:23)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
at org.eclipse.osgi.container.Module.doStart(Module.java:603)
at org.eclipse.osgi.container.Module.start(Module.java:467)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1844)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1837)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1780)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1742)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1664)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.fx.osgi.fxloader.jpms.ModuleLayerWrapper$ControllerWrapper.addExports(ModuleLayerWrapper.java:170)
... 68 more
Caused by: java.lang.IllegalArgumentException: module javafx.base not in layer
at java.base/java.lang.ModuleLayer$Controller.ensureInLayer(ModuleLayer.java:216)
at java.base/java.lang.ModuleLayer$Controller.addExports(ModuleLayer.java:268)
... 73 more


Thomas Schindl wrote on Wed, 13 January 2021 10:40
well the problem is that ScenicView is trying to load stuff through the Systemclassloader which can not work as those are loaded in an extra JPMS-Layer and each layer has to have a distinct classloader. So you have 2 options:
* Use something like ZuluFX which includes JavaFX as part of the System-Modules
* Do not launch ScenicView as an external application but wrap it as an OSGi-Module and create an instance as part of your OSGi-Application

Previous Topic:java.lang.ExceptionInInitializerError at javafx.scene.web.WebEngine.<clinit>(WebEngine.java:3
Goto Forum:
  


Current Time: Mon Jan 25 15:02:11 GMT 2021

Powered by FUDForum. Page generated in 0.02450 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top