Using CcontrolsFX's SpreadsheetView in Java 9 - javafx

I've got an application written in Java 8 with ControlsFX 8.40.14.
I run the app under Java 9 (jdk-9.0.1 to be precise) and I got the following exception when the app tries to display SpreadsheetView component.
Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: javafx.scene.control.TableColumn.impl_setReorderable(Z)V
at org.controlsfx.control.spreadsheet.SpreadsheetView.getTableColumn(SpreadsheetView.java:2216)
at org.controlsfx.control.spreadsheet.SpreadsheetView.setGrid(SpreadsheetView.java:1162)
at org.controlsfx.control.spreadsheet.SpreadsheetView.<init>(SpreadsheetView.java:563)
at org.controlsfx.control.spreadsheet.SpreadsheetView.<init>(SpreadsheetView.java:475)
(...)javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3589)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.access$8300(Scene.java:3517)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3885)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
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:175)
at java.base/java.lang.Thread.run(Thread.java:844)
The same exception occurs when the app is compiled with jdk1.8.144 and jdk-9.0.1
I cannot migrate to ControlsFX 9.0.0 as they don't support SpreadsheetView yet.
Any idea how to run such an application in Java 9?

this may be late but a lot of controlsfx components do not work on JDK 9 because of couple of reasons, a lot of controlsfx components were not compatible with JDK 9,, thus version 9 was released to migrate from JDK 8 to 9,,, however, SpreadSheetView is removed...
check this issue: https://bitbucket.org/controlsfx/controlsfx/issues/780/controlsfx-should-support-java-9
as kerry said, used JDK 8

Looking at the first line of the error:
Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: javafx.scene.control.TableColumn.impl_setReorderable(Z)V
The method TableColumn.imp_setReorderable() I suspect is an internal and undocumented method? Possibly it has been removed in the JDK you are using (1.8.144).
I notice from the manifest for ControlsFX that version 8.40.14 was built with JDK1.8.0_131.
You could try obtaining JDK 1.8.0_131 and try running your application with that?

Related

Spring web server could not load Cordapp. Fails to find the State class. Error - AMQ214000: Failed to call onMessage

I am in process of migrating my cordapp from Corda v1.0 to Corda v4.0. I am following step-by-step migration method.
While migrating the cordapp from Corda v1.0 to Corda v2.0, the nodes get successfully deployed and run, but on running Springboot webserver, I am getting error - "java.lang.ClassNotFoundException: net.corda.bgc.contract.State" in the node cmd window.
[The nodes and webserver runs successully with Corda v1.0.]
Following are the details of the error -
Springbootweb server after starting successfully, freezes
while connecting to CorDapp. Following is the stacktrace from web server cmd window -
I 17:50:49 1 Server.doStart - Started #29133ms
I 17:50:54 1 RPCClient.logElapsedTime - Startup took 3682 msec
<==I 17:50:54 1 ThreadPoolTaskExecutor.initialize - Initializing ExecutorService 'clientInboundChannelExecutor'
I 17:50:54 1 ThreadPoolTaskExecutor.initialize - Initializing ExecutorService 'clientOutboundChannelExecutor'
> :server:runMyCorpUSAServer
Following is the stacktrace from node cmd window -
Mon Jun 03 18:08:07 IST 2019>>> E 18:09:20+0530 [Thread-1 (ActiveMQ-client-global-threads)] core.client.run - AMQ214000: Failed to call onMessage
java.lang.ClassNotFoundException: net.corda.bgc.contract.State
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_212]
at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_212]
at net.corda.nodeapi.internal.serialization.ClassSerializer.read(Kryo.kt:526) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.ClassSerializer.read(Kryo.kt:523) ~[corda-node-api-2.0.0.jar:?]
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.DefaultSerializers$CollectionsSingletonListSerializer.read(DefaultSerializers.java:577) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.serializers.DefaultSerializers$CollectionsSingletonListSerializer.read(DefaultSerializers.java:567) ~[kryo-4.0.0.jar:?]
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(SerializationScheme.kt:209) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1$1.invoke(SerializationScheme.kt:152) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.withContext(SerializationScheme.kt:191) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.access$withContext(SerializationScheme.kt:152) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme$deserialize$$inlined$use$lambda$1.execute(SerializationScheme.kt:206) ~[corda-node-api-2.0.0.jar:?]
at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61) ~[kryo-4.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.AbstractKryoSerializationScheme.deserialize(SerializationScheme.kt:205) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1$1.invoke(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.core.serialization.SerializationFactory.withCurrentContext(SerializationAPI.kt:53) ~[corda-core-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl$deserialize$1.invoke(SerializationScheme.kt:95) ~[corda-node-api-2.0.0.jar:?]
at net.corda.core.serialization.SerializationFactory.asCurrent(SerializationAPI.kt:67) ~[corda-core-2.0.0.jar:?]
at net.corda.nodeapi.internal.serialization.SerializationFactoryImpl.deserialize(SerializationScheme.kt:115) ~[corda-node-api-2.0.0.jar:?]
at net.corda.nodeapi.RPCApi$ClientToServer$Companion.fromClientMessage(RPCApi.kt:234) ~[corda-node-api-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer.clientArtemisMessageHandler(RPCServer.kt:263) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer.access$clientArtemisMessageHandler(RPCServer.kt:76) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:189) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:76) ~[corda-node-2.0.0.jar:?]
at net.corda.node.services.messaging.RPCServerKt$sam$MessageHandler$b852d39b.onMessage(RPCServer.kt) ~[corda-node-2.0.0.jar:?]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:997) ~[artemis-core-client-2.1.0.jar:2.1.0]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) ~[artemis-core-client-2.1.0.jar:2.1.0]
at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1120) [artemis-core-client-2.1.0.jar:2.1.0]
at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:101) [artemis-commons-2.1.0.jar:2.1.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_212]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_212]
Kindly provide insights regarding above.
Thanks in advance.
The issue got resolved by copying cordapp jar file into "plugins" directory of each node.
In Corda V1, the copying of cordapp jar file to "plugins" directory of each node was done by the process whereas in Corda V2, it seems we have to do it manually. Please correct me if I am wrong.

com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into x folder

Recently migrated to JxBrowser 7.0 and i have the following error coming every time i try to start the application .
com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0
at jxbrowser#7.0/com.teamdev.jxbrowser.internal.ChromiumExtractor.extract(ChromiumExtractor.java:45)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.extractChromiumBinaries(EngineImpl.java:386)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:156)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:96)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.initialize(WebBrowserTabController.java:191)
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:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.<init>(WebBrowserTabController.java:166)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createNewTab(WebBrowserController.java:180)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createAndAddNewTab(WebBrowserController.java:161)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.initialize(WebBrowserController.java:116)
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:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.<init>(WebBrowserController.java:99)
at XR3Player/com.goxr3plus.xr3player.application.MainLoader.lambda$startPart2$8(MainLoader.java:373)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
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:835)
It says caused by :
Caused by: java.io.FileNotFoundException: chromium-win64.7z, chromium-win32.7z
... 44 more
where is this coming from ? My project is a Maven project and i have added all the needed dependencies and on the start of application i have added the license key and the directory i want to browser to have it's files :
static {
// Chromium Extract Location Dir
System.setProperty("jxbrowser.license.key", "license_key");
System.setProperty("jxbrowser.chromium.dir",
DatabaseTool.getAbsoluteDatabaseParentFolderPathWithSeparator() + "Chrome" + "7.0");
}
Enabling JxBrowser Logger :
01:19:49.837 DEBUG Verifying Chromium binaries...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.839 DEBUG Verifying Chromium binaries... [FAIL]
01:19:49.839 DEBUG Finding Chromium binaries in JARs...
01:19:49.839 DEBUG Finding WIN_64...
01:19:49.840 DEBUG Finding WIN_64... [FAIL]
01:19:49.840 DEBUG Finding WIN_32...
01:19:49.840 DEBUG Finding WIN_32... [FAIL]
Maven Dependencies :
<!-- CHROMIUM BROWSER -->
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-win64</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-javafx</artifactId>
<version>7.0</version>
</dependency>
I believe this happens when you set up the project in an IDE and add the jxbrowser dependencies as libraries. For me, intellij did not recognize the os specific chromium jar as a valid jar directory. It did not place this jar in the classpath.
In my case, the resource not found was -
jxbrowser-linux64-7.5.jar
This jar contains - chromium-*.7z which is needed by jxbrowser.
I extracted and unzipped this file to an accessible location.
The location for the chromium installation should then be provided to the engine-
Engine engine = Engine.newInstance(
EngineOptions.newBuilder(HARDWARE_ACCELERATED)
.chromiumDir(Paths.get("/home/rgupta/.jxbrowser/chromium/chromium-linux64"))
.build());
Then, jxbrowser started working.
I had the same bug when i added the OS specific jar in Intellij classpath. What i have done to fix it is to remove it and put it back again. Intellij don't recognize it and display a popup with options to select what kind of jar it is. then select classes.

How to open fxml file in netbeans? [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 3 years ago.
I am working with scene builder that I save as fxml file. When I open it on netbeans it generates the following error.
Executing C:\Users\Niw\Documents\NetBeansProjects\school_system\dist\run803183839\school_system.jar using platform C:\Program Files(x86)\Java\jdk1.8.0_131\jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
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:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
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:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsupportedClassVersionError:
com/jfoenix/controls/JFXButton has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2916)
at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2905)
at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2846)``
at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2692)
at javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2661)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2517)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
at school_system.School_system.start(School_system.java:29)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application school_system.School_system
Java Result: 1
What should I do?
The problem is that your application was compiled using JDK 9, but you are trying to run it using JRE 8:
The relevant part of your stack trace which shows this is this message:
Caused by: java.lang.UnsupportedClassVersionError:
com/jfoenix/controls/JFXButton has been compiled by a more recent
version of the Java Runtime (class file version 53.0),
this version of the Java Runtime only recognizes class file versions
up to 52.0
The first line of your stack trace confirms that your are using JRE 1.8 which equates to class file version 52.0:
...using platform C:\Program Files(x86)\Java\jdk1.8.0_131\jre/bin/java
However, your project has been compiled using JDK 9, which equates to class file version 53.0 as detailed in the error message for the UnsupportedClassVersionError shown above.
There are two possible ways to resolve your problem in NetBeans:
Use a more recent version of JRE to run your application, with a version >= JRE 9. To do that:
Select your project in the Projects pane, right click to open the context menu and select Properties.
Select Libraries from the list of Categories, then select a JDK from the Java Platform drop list which is >= JDK 9.
Use only JDK 8 (if, and only if, that is possible):
Select Sources from the list of Categories, then select a JDK 8 from the Source/Binary Format drop list.
Rebuild your application.
After taking one of those two approaches you should be able to run your application in NetBeans.

Roboelectric 2.2 error

I am getting the following error with roboelectric 2.2
java.lang.IncompatibleClassChangeError: class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.robolectric.RobolectricTestRunner.createRobolectricClassLoader(RobolectricTestRunner.java:144)
at org.robolectric.RobolectricTestRunner.createSdkEnvironment(RobolectricTestRunner.java:116)
at org.robolectric.RobolectricTestRunner$3.create(RobolectricTestRunner.java:279)
at org.robolectric.EnvHolder.getSdkEnvironment(EnvHolder.java:21)
at org.robolectric.RobolectricTestRunner.getEnvironment(RobolectricTestRunner.java:277)
at org.robolectric.RobolectricTestRunner.access$100(RobolectricTestRunner.java:57)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:188)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I configured using the site http://www.androiddevelopersolution.com/2013/03/android-unit-testing-with-robolectric.html
I am using the android jar file in the application and the test project. Any suggestions? Thank you.
yes, I had the same problem, asm version issue as #thoutisbeckers said. Try this:
dependencies {
androidTestCompile 'org.robolectric:robolectric:2.+'
androidTestCompile 'junit:junit:4.+'
compile 'org.ow2.asm:asm:4.0'
compile ('org.roboguice:roboguice:2.0') {
exclude module: 'asm'
}
}
This looks like you're using version 1.7 of the JDK to compile and run your Robolectric tests. JDK 1.7 is incompatible with Robolectric and can result in issues similar to the one you're seeing.
You likely have a dependency somewhere on an old version of asm (lower than version 4). Make sure you exclude it from the build path since Robolectric only work with 4 an up.
In my case it was a version of Guice that contributed it.

error when doing grails clean or grails run-app after upgrading to ver 2.1 from 1.3.7

I just upgraded to grails 2.1.. the latest release available, from grails 1.3.7,
I have updated the grails_home and path environment variables to reflect this new version. but when I do grails run-app or grails clean I get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/cli/support/GrailsStarter
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.cli.support.GrailsStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.groovy.grails.cli.support.GrailsStarter. Program will exit.
I have groovy ver 1.8.3 setup already.
What am I missing or doing wrong here?
Thanks
Have you tried to refresh dependencies before executing clean or compile ?

Resources