eclipse-efx / efxclipse-eclipse

Eclipse Public License 2.0
15 stars 5 forks source link

Using Java 11 results in The type javafx.collections.ListChangeListener$Change cannot be resolved. It is indirectly referenced from required .class files #56

Closed vogella closed 5 years ago

vogella commented 6 years ago

I'm following the instructions from https://github.com/eclipse-efx/efxclipse-eclipse/wiki/Eclipse4-application-on-OpenJFX-11

After the Create a new "e4 Application projects" using the wizard "New Project" wizard step I get the following error:

Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for javafx.collections.ObservableList. Fix the build path then try building this project e4testapp.app Unknown Java Problem The type javafx.collections.ObservableList cannot be resolved. It is indirectly referenced from required .class files DefaultTheme.java /e4testapp.app/src/e4testapp/app/themes line 1 Java Problem

tomsontom commented 6 years ago

So did you set the preference pointing to the JavaFX-SDK? Is the project use JavaSE-11?

vogella commented 6 years ago

So did you set the preference pointing to the JavaFX-SDK? Is the project use JavaSE-11? Yes

tomsontom commented 6 years ago

so can you show me the PDE-Classpath-Container in your PackageExplorer?

vogella commented 6 years ago

For unknown reasons, I cannot upload images to issues.

PDE classpath container: https://ibb.co/RhtfnRd Preference setting for FX: https://ibb.co/Kh8320Y

tomsontom commented 6 years ago

Ok i think i see the error can you try pointing to the lib-folder? We should add validation to the Preference-Page?

vogella commented 6 years ago

Thanks, after pointing to the lib folder, the project compiles but if I start it via the product I still get the error that the javax/applicatoin/Applicatioin cannot be found. I assume the javafx*.jar are not available at runtime.

tomsontom commented 6 years ago

hm - yes you added the http://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/ all the bundle contained in it? To your launch config right?

tomsontom commented 6 years ago

Does the launch configuration/product contain "-Dosgi.framework.extensions=org.eclipse.fx.osgi " in the VM-Arguments?

vogella commented 6 years ago

Does the launch configuration/product contain "-Dosgi.framework.extensions=org.eclipse.fx.osgi " in the > VM-Arguments?

This was not part of the instructions in https://github.com/eclipse-efx/efxclipse-eclipse/wiki/Eclipse4-application-on-OpenJFX-11, I added it now but it did not make a difference.

hm - yes you added the http://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/ all the bundle contained in it? To your launch config right?

Sorry, I don't understand this question. I did add http://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/ to my target platform if that is what you mean.

https://ibb.co/QMCDW2M

tomsontom commented 6 years ago

and is that feature part of the launch config? What does "ss openjfx" print in the console? You can launch with "-Defxclipse.osgi.hook.debug=true" included to see the classloading being done? If you don't get any output you know somethings fishy

vogella commented 6 years ago

openjfx.standard.feature.feature.group is part of the product but if I start I see the message:

ENTRY org.eclipse.osgi 4 0 2018-12-06 15:53:50.543 !MESSAGE Bundle org.eclipse.fx.osgi not found.

vogella commented 6 years ago

ss openfx does return an empty result.

tomsontom commented 6 years ago

ok that is the problem - can you add this fragment to your feature.xml please and retry?

tomsontom commented 6 years ago

hm ss openjfx should not return an empty result, did you check that it is in the .launch-config as well?

vogella commented 6 years ago

org.eclipse.fx.osgi is not available in the openjfx.standard.feature nor the org.eclipse.fx.runtime.e4fx.feature.

Which feature should contain this plug-in?

tomsontom commented 6 years ago

hm min.feature? I'm uncertain we should add it to runtime.e4.feature? The reason it is not in runtime.e4.feature is that you did not needed this adapterhook for FX-8.

vogella commented 6 years ago

Adding "Minimal JavaFX OSGi integration bundles" to the target platform looks better now but the application still does not start. I added a TrimmedWindow and set the clean workspace flag.

Output:

FXClassLoader#findClassJavaFX11 - started FXClassLoader#findClassJavaFX11 - Loading class 'org.apache.felix.shell.Command' FXClassLoader#getDeployedJavaModuleBundlePaths - Loading libraries from deployed modules FXClassLoader#getDeployedJavaModuleBundlePaths - Found OSGi-Module with JPMS-Module 'javafx.base' FXClassLoader#getDeployedJavaModuleBundlePaths - Found Jar 'bundleentry://108.fwk669965156/javafx.base.jar' FXClassLoader#getDeployedJavaModuleBundlePaths - Converted URL: file:/C:/Users/ex0227/workspace/efxclipse/.metadata/.plugins/org.eclipse.pde.core/e4testapp.app.product.product/org.eclipse.osgi/108/0/.cp/javafx.base.jar FXClassLoader#getDeployedJavaModuleBundlePaths - Found OSGi-Module with JPMS-Module 'javafx.controls' FXClassLoader#getDeployedJavaModuleBundlePaths - Found Jar 'bundleentry://109.fwk669965156/javafx.controls.jar' FXClassLoader#getDeployedJavaModuleBundlePaths - Converted URL: file:/C:/Users/ex0227/workspace/efxclipse/.metadata/.plugins/org.eclipse.pde.core/e4testapp.app.product.product/org.eclipse.osgi/109/0/.cp/javafx.controls.jar FXClassLoader#getDeployedJavaModuleBundlePaths - Found OSGi-Module with JPMS-Module 'javafx.fxml' FXClassLoader#getDeployedJavaModuleBundlePaths - Found Jar 'bundleentry://110.fwk669965156/javafx.fxml.jar' FXClassLoader#getDeployedJavaModuleBundlePaths - Converted URL: file:/C:/Users/ex0227/workspace/efxclipse/.metadata/.plugins/org.eclipse.pde.core/e4testapp.app.product.product/org.eclipse.osgi/110/0/.cp/javafx.fxml.jar FXClassLoader#getDeployedJavaModuleBundlePaths - Found OSGi-Module with JPMS-Module 'javafx.graphics' FXClassLoader#getDeployedJavaModuleBundlePaths - Found Jar 'bundleentry://111.fwk669965156/javafx.graphics.jar' FXClassLoader#getDeployedJavaModuleBundlePaths - Converted URL: file:/C:/Users/ex0227/workspace/efxclipse/.metadata/.plugins/org.eclipse.pde.core/e4testapp.app.product.product/org.eclipse.osgi/111/0/.cp/javafx.graphics.jar FXClassLoader#advancedModuleLayerBoostrap - Using advanced layer creation to apply patches FXClassLoader#advancedModuleLayerBoostrap - javafx.base => C:\Users\ex0227\workspace\efxclipse.metadata.plugins\org.eclipse.pde.core\e4testapp.app.product.product\org.eclipse.osgi\108\0.cp\javafx.base.jar FXClassLoader#advancedModuleLayerBoostrap - javafx.controls => C:\Users\ex0227\workspace\efxclipse.metadata.plugins\org.eclipse.pde.core\e4testapp.app.product.product\org.eclipse.osgi\109\0.cp\javafx.controls.jar FXClassLoader#advancedModuleLayerBoostrap - javafx.fxml => C:\Users\ex0227\workspace\efxclipse.metadata.plugins\org.eclipse.pde.core\e4testapp.app.product.product\org.eclipse.osgi\110\0.cp\javafx.fxml.jar FXClassLoader#advancedModuleLayerBoostrap - javafx.graphics => C:\Users\ex0227\workspace\efxclipse.metadata.plugins\org.eclipse.pde.core\e4testapp.app.product.product\org.eclipse.osgi\111\0.cp\javafx.graphics.jar JavaModuleLayerModification#applyConfigurations - Exporting 'javafx.graphics/com.sun.javafx.application=BUNDLE(@97)' FXClassLoader#findClassJavaFX11 - Using classloader org.eclipse.fx.osgi.fxloader.FXClassLoader$1@4648ce9 FXClassLoader#findClassJavaFX11 - started FXClassLoader#findClassJavaFX11 - Loading class 'com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl' FXClassLoader#findClassJavaFX11 - Using classloader org.eclipse.fx.osgi.fxloader.FXClassLoader$1@4648ce9 FXClassLoader#findClassJavaFX11 - ended FXClassLoader#findClassJavaFX11 - started FXClassLoader#findClassJavaFX11 - Loading class 'javafx.application.Application' FXClassLoader#findClassJavaFX11 - Using classloader org.eclipse.fx.osgi.fxloader.FXClassLoader$1@4648ce9 FXClassLoader#findClassJavaFX11 - ended log4j:WARN No appenders could be found for logger (com.sun.glass.ui.win.WinApplication). log4j:WARN Please initialize the log4j system properly.

tomsontom commented 6 years ago

Yeah this output now looks ok. Does the window have a x/y/height/width?

vogella commented 6 years ago

Yeah this output now looks ok. Does the window have a x/y/height/width?

Yes.

I see that I get a NPE in D3DPipeline

@Override public int getAdapterOrdinal(Screen screen) { return nGetAdapterOrdinal(screen.getNativeScreen()); }

tomsontom commented 6 years ago

Ah over f...! You run into https://bugs.eclipse.org/bugs/show_bug.cgi?id=540247 please add a -Djava.library.path=YOUDONTKNOWWHATYOUDOECLIPSE

vogella commented 6 years ago

Thanks, Tom. Now the application starts.

I try to sum this up and send an PR for https://github.com/eclipse-efx/efxclipse-eclipse/wiki/Eclipse4-application-on-OpenJFX-11 as IMHO some critical steps are missing.

tomsontom commented 6 years ago

guess how long it took me to find out the last thing, when I encountered - endless debugging sessions!

vogella commented 6 years ago

guess how long it took me to find out the last thing, when I encountered - endless debugging sessions!

I can image that this was almost impossible to find.

tomsontom commented 6 years ago

As it looks like you are open for adventures.

You can give https://github.com/BestSolution-at/e4-efxclipse-maven-sample a spin. I tested this on OS-X and Windows and there it worked for me. The sample is made for Java-11, so don't try with Java-8.

This is the suggested way forward for "e4 on JavaFX" although we will for the midterm support PDE as well.