Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » java.lang.IllegalArgumentException: module javafx.graphics not in layer(When starting my e4 Java FX (Java 11) RCP application, the expection " java.lang.IllegalArgumentException: module javafx.graphics not in layer".)
java.lang.IllegalArgumentException: module javafx.graphics not in layer [message #1827980] Thu, 28 May 2020 08:04 Go to next message
Ignacio A is currently offline Ignacio AFriend
Messages: 4
Registered: May 2020
Junior Member
This is my current configuration:
OS: Windows 10
JRE: AdoptOpenJDK 11.0.7
JavaFX: openjfx-11.0.2
e(fx)clipse: 3.7.0.202005270700 from (https://download.eclipse.org/efxclipse/updates-nightly/site/)
Target Platform 3.7.0.202005280600 downloaded from https://download.eclipse.org/efxclipse/runtime-nightly/site/

index.php/fa/38201/0/

When I run my E4 JavaFX RCP application I get this error message:

java.lang.IllegalArgumentException: module javafx.graphics not in layer

But the application can start and I can show a simple Part like described in the tutorials / examples.


Launch Configuration:
To start my RCP application I select all the plugins from the Target Platform + my RCP Application Plugin.
In the VM arguments of the launch configuration I set following:

--module-path "MY_PATH_TO_THE_JAVAFX_11_LIB_DIR" --add-modules javafx.controls,javafx.fxml,javafx.graphics
-Dosgi.framework.extensions=org.eclipse.fx.osgi

index.php/fa/38200/0/

Do you know why this is happening and is there a solution for it?
I still can start the application, but I have not yet put more than one BorderPane and a Text in it. Is this exception a problem that should be fix before continuing implementing JavaFX elements? Can this exception be ignored or is it a bigger issue?


Quote:

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:457)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.initModuleLayer(FXClassLoader.java:400)
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.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
at org.eclipse.e4.core.internal.di.InjectorImpl.getDeclaredConstructors(InjectorImpl.java:822)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:380)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
at org.eclipse.fx.ui.workbench.renderers.base.BasePartRenderer.doProcessContent(BasePartRenderer.java:213)
at org.eclipse.fx.ui.workbench.renderers.base.BasePartRenderer.doProcessContent(BasePartRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.processContent(BaseRenderer.java:757)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:248)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:327)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.engineCreateWidget(BaseRenderer.java:663)
at org.eclipse.fx.ui.workbench.renderers.base.BaseSashRenderer.doProcessContent(BaseSashRenderer.java:132)
at org.eclipse.fx.ui.workbench.renderers.base.BaseSashRenderer.doProcessContent(BaseSashRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.processContent(BaseRenderer.java:757)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:248)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:327)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.engineCreateWidget(BaseRenderer.java:663)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveRenderer.doProcessContent(BasePerspectiveRenderer.java:113)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveRenderer.doProcessContent(BasePerspectiveRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.processContent(BaseRenderer.java:757)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:248)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:327)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.engineCreateWidget(BaseRenderer.java:663)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer$6.call(BasePerspectiveStackRenderer.java:219)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer$6.call(BasePerspectiveStackRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.fx.DefPerspectiveStackRenderer$PerspectiveStackItemImpl$1.run(DefPerspectiveStackRenderer.java:183)
at org.eclipse.fx.ui.workbench.renderers.fx.widget.PerspectiveStackItem.getContent(PerspectiveStackItem.java:28)
at org.eclipse.fx.ui.workbench.renderers.fx.DefPerspectiveStackRenderer$PerspectiveStackImpl.selectItem(DefPerspectiveStackRenderer.java:266)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer.handleSelectedElement(BasePerspectiveStackRenderer.java:283)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer$2.handleEvent(BasePerspectiveStackRenderer.java:102)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
at org.eclipse.fx.ui.controls.internal.FXThreadSynchronizeImpl.syncExec(FXThreadSynchronizeImpl.java:109)
at org.eclipse.fx.ui.workbench.fx.internal.UISynchronizeImpl.syncExec(UISynchronizeImpl.java:51)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:152)
at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer.doProcessContent(BasePerspectiveStackRenderer.java:199)
at org.eclipse.fx.ui.workbench.renderers.base.BasePerspectiveStackRenderer.doProcessContent(BasePerspectiveStackRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.processContent(BaseRenderer.java:757)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:248)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:327)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.engineCreateWidget(BaseRenderer.java:663)
at org.eclipse.fx.ui.workbench.renderers.base.BaseWindowRenderer.doProcessContent(BaseWindowRenderer.java:445)
at org.eclipse.fx.ui.workbench.renderers.base.BaseWindowRenderer.doProcessContent(BaseWindowRenderer.java:1)
at org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer.processContent(BaseRenderer.java:757)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:248)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.createGui(PartRenderingEngine.java:327)
at org.eclipse.fx.ui.workbench.fx.PartRenderingEngine.run(PartRenderingEngine.java:482)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.fx.ui.workbench.fx.E4Application$1.lambda$0(E4Application.java:259)
at org.eclipse.fx.ui.controls.internal.FXThreadSynchronizeImpl.syncExec(FXThreadSynchronizeImpl.java:109)
at org.eclipse.fx.ui.workbench.fx.E4Application$1.run(E4Application.java:249)
at org.eclipse.fx.ui.workbench.fx.E4Application.jfxStart(E4Application.java:271)
at org.eclipse.fx.ui.workbench.fx.DefaultJFXApp.start(DefaultJFXApp.java:60)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
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)
... 91 more
Caused by: java.lang.IllegalArgumentException: module javafx.graphics 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)
... 95 more
Re: java.lang.IllegalArgumentException: module javafx.graphics not in layer [message #1827990 is a reply to message #1827980] Thu, 28 May 2020 13:57 Go to previous message
Ignacio A is currently offline Ignacio AFriend
Messages: 4
Registered: May 2020
Junior Member
I found the problem in my launch configuration. I had the wrong VM parameters.
This parameter must be set to use e(fx)clipse:

-Dorg.osgi.framework.bundle.parent=ext

Here there are some tutorials for migrating from E4-SWT to E4-Javafx:

https://www.youtube.com/watch?v=43OjWKs0jew
http://www.kware.net/?p=64#Efxclipse_Runtime
https://blog.codecentric.de/en/2015/02/swt-javafx-migration-eclipse-rcp-cookbook/

Previous Topic:JavaFX jars missing in Plug-in Dependencies during migration from Java8 e4-swt to Java 11 e4-javafx
Next Topic:Problems and Crash with DriftFXSurface
Goto Forum:
  


Current Time: Fri Sep 25 04:37:03 GMT 2020

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

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

Back to the top