GVM и Proxy для класса с модульной системой не полностью инициализированы
Я получаю следующую ошибку при запуске приложения:
Прокси не поддерживается до полной инициализации модульной системы
Полагаю, трассировка стека мало чем поможет?
[SUB] java.lang.InternalError: Proxy is not supported until module system is fully initialized
[SUB] at java.lang.Throwable.fillInStackTrace(Unknown Source)
[SUB] at java.lang.Throwable.<init>(Unknown Source)
[SUB] at java.lang.Error.<init>(Unknown Source)
[SUB] at java.lang.VirtualMachineError.<init>(Unknown Source)
[SUB] at java.lang.InternalError.<init>(Unknown Source)
[SUB] at java.lang.reflect.Proxy$ProxyBuilder.<init>(Unknown Source)
[SUB] at java.lang.reflect.Proxy$ProxyBuilder.<init>(Unknown Source)
[SUB] at java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Unknown Source)
[SUB] at java.lang.reflect.Proxy$$Lambda$1.apply(Unknown Source)
[SUB] at jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(Unknown Source)
[SUB] at jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(Unknown Source)
[SUB] at java.lang.reflect.Proxy.getProxyConstructor(Unknown Source)
[SUB] at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
[SUB] at javax.rad.util.EventHandler$ListenerHandler.<init>(Unknown Source)
[SUB] at javax.rad.util.EventHandler.setDefaultListener(Unknown Source)
[SUB] at javax.rad.genui.container.AbstractFrame.<init>(Unknown Source)
[SUB] at javax.rad.application.genui.UILauncher.<init>(Unknown Source)
[SUB] at com.sibvisions.rad.ui.javafx.impl.JavaFXLauncher.createUILauncher(Unknown Source)
[SUB] at com.sibvisions.mobilefx.DesktopJavaFXLauncher.createUILauncher(Unknown Source)
[SUB] at com.sibvisions.rad.ui.javafx.impl.JavaFXLauncher.<init>(Unknown Source)
[SUB] at com.sibvisions.mobilefx.DesktopJavaFXLauncher.<init>(Unknown Source)
[SUB] at com.sibvisions.mobilefx.MobileJavaFXLauncher.<init>(Unknown Source)
[SUB] at com.sibvisions.mobilefx.MobileJavaFXApplication.createLauncher(Unknown Source)
[SUB] at com.sibvisions.rad.ui.javafx.impl.JavaFXApplication.start(Unknown Source)
[SUB] at com.sibvisions.mobilefx.MobileJavaFXApplication.start(Unknown Source)
[SUB] at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
[SUB] at com.sun.javafx.application.LauncherImpl$$Lambda$9.run(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl$$Lambda$10.run(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl$$Lambda$22.run(Unknown Source)
[SUB] at java.security.AccessController.doPrivileged(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
[SUB] at com.sun.javafx.application.PlatformImpl$$Lambda$9.run(Unknown Source)
То, что мы делаем, не сложно. Мы просто создаем прокси-класс для интерфейса. Должны ли мы ждать "инициализированный" или аналогичный, прежде чем мы запустим "приложение"?
Хм... почему модульная система унифицирована?
Вот простой пример приложения, основанного на шаблоне проекта Eclipse:
public class Application extends MobileApplication
{
@Override
public void init()
{
try
{
//Runnable is only an example, the problem occurs with any interface
Proxy.newProxyInstance(getClass().getClassLoader(), new Class<?>[] {Runnable.class}, new InvocationHandler()
{
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
return null;
}
});
}
catch (Throwable th)
{
th.printStackTrace();
}
addViewFactory(HOME_VIEW, BasicView::new);
}
@Override
public void postInit(Scene scene)
{
Swatch.BLUE.assignTo(scene);
((Stage) scene.getWindow()).getIcons().add(new Image(Application.class.getResourceAsStream("/icon.png")));
}
}