Having trouble launching a JavaFx Gui Program - javafx

Im having trouble launching a simple GUI i javafx and its giving me all sorts of errors. Can anyone help me to know whats going wrong
This is the error that im getting
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: javafx/css/StyleableObjectProperty
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
at java.lang.Class.getConstructor0(Class.java:2723)
at java.lang.Class.getConstructor(Class.java:1676)
at sun.reflect.misc.ConstructorUtil.getConstructor(ConstructorUtil.java:38)
at javafx.fxml.JavaFXBuilderFactory.getBuilder(JavaFXBuilderFactory.java:121)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:805)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:565)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2314)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2131)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2744)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2723)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2709)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2696)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2685)
at oasis.estock.OasisEstock.start(OasisEstock.java:27)

Related

Caused by: java.lang.IllegalStateException: Not in an app context

Getting Caused by: java.lang.IllegalStateException: Not in an app context error while running corda app.
Caused by: java.lang.IllegalStateException: Not in an app context
at net.corda.node.internal.cordapp.CordappProviderImpl.getAppContext(CordappProviderImpl.kt:67)
at net.corda.core.node.ServiceHub$DefaultImpls.getAppContext(ServiceHub.kt:428)
at net.corda.core.internal.ServiceHubCoreInternal$DefaultImpls.getAppContext(ServiceHubCoreInternal.kt)
at net.corda.node.services.api.ServiceHubInternal$DefaultImpls.getAppContext(ServiceHubInternal.kt)
at net.corda.node.internal.AbstractNode$ServiceHubInternalImpl.getAppContext(AbstractNode.kt:1115)
at net.corda.core.flows.FinalityFlow.call(FinalityFlow.kt:138)
at net.corda.core.flows.FinalityFlow.call(FinalityFlow.kt:42)
at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:331)
at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:338)

Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext

I want to build an app with Ionic V3 for Android but I have an issue when I build it on release.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.security.Provider$Service.getImplClass(Provider.java:1728)
at java.security.Provider$Service.newInstance(Provider.java:1686)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
at com.crashlytics.reloc.org.apache.http.ssl.SSLContexts.createDefault(SSLContexts.java:51)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:56)
at com.crashlytics.api.net.proxy.ProxySettings.getClientFor(ProxySettings.java:56)
at com.crashlytics.api.RestfulWebApi.notifyBuildEvent(RestfulWebApi.java:1438)
at com.crashlytics.api.RestfulWebApi.access$100(RestfulWebApi.java:74)
at com.crashlytics.api.RestfulWebApi$10.run(RestfulWebApi.java:1371)
at java.lang.Thread.run(Thread.java:748)
It seems to be caused by Crashlytics (which I don't even use) which is integrated within this package https://github.com/dpa99c/cordova-plugin-firebasex.
When I build the app in debug mode, I still have the exception but the build proceed until the end and I still can run it on my phone.
How can I prevent this issue ? Is there anyway to disable entirely Crashlytics so I don't have this exception anymore ?
Thanks
Ok, so it was all because of the JDK version. I ended up updating the JDK and everything worked perfectly.

fatal exception in android studio after compiling

Hi am beginner in android studio while performing fragment example in android studio i got this error while running of my project while clicking a button in my app it shows a message "Unfortunately your app has stopped".I have checked in my log it shows the following i don't know how to solve it.???
com.example.xxx.xxx E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.ClassCastException: com.example.xxx.xxx.MenuFragment cannot be cast to com.example.xxxx.xxxx.TextFragment
at com.example.xxxx.xxx.MenuFragment.onListItemClick(MenuFragment.java:28)
at android.app.ListFragment$2.onItemClick(ListFragment.java:160)
at android.widget.AdapterView.performItemClick(AdapterView.java:301)
at android.widget.AbsListView.performItemClick(AbsListView.java:1584)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3399)
at android.widget.AbsListView$1.run(AbsListView.java:4653)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
thank you in advance

Exception error while running a JavaFX2 app with CSS

I am making a text editor app in JavaFX2 on NetBeans. My problem is this: whenever I try to insert the line scene.getStylesheets().add(<classname>.class.getResource("<css file>.css").toExternalForm()); to link the css, and run it, it shows an error: "Exception while running Application"What exactly is this exception? I've tried removing this line, and then the app runs smoothly. Just five-six hours back, I had inserted this same line of code (with correct classes and css file), it was easily able to use the css. But now, I've created another 3 projects to check it, but the app shows the same error and gets removed on removing this code. I create the Css by right-clicking the Source-packages icon > new > Cascading Style Sheets. I fill in all the correct classes and location for css file, yet this happens. Also tried Shift + F11 (clean and rebuild). When I launch the older app(with css), it runs without an error. (BTW I use Win8 Pro x64, if u need it)The output panel stops at Executing com.javafx.main.Main from <location>\Qwerty.jar using platform C:\Program Files\Java\jdk1.7.0_17/bin/java and then shows error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.javafx.main.Main.launchApp(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at qwerty.Qwerty.start(Qwerty.java:36) (LINE 36 is where the reference to css is)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
Java Result: 1
The issue is explained in the nested excpetion:
Caused by: java.lang.NullPointerException
at qwerty.Qwerty.start(Qwerty.java:36) (LINE 36 is where the reference to css is)
Check if <classname>.class.getResource("<css file>.css") is null. Maybe you're specifing the wrong path or the css is not in the jar?

How do I remove the null pointer exception from this code in processing

I am trying to do this project I found in instructbles.
http://www.instructables.com/id/Touche-for-Arduino-Advanced-touch-sensing/?ALLSTEPS
There is an Arduino code and a Processing code that needs to be run to implement this project.
The codes can be found here.
https://github.com/Illutron/AdvancedTouchSensing
The arduino code runs fine. But the one in processing gives a NullPointerException error and the output is just a plain white window instead of the desired graphs.
The complete error message is as follows:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
[0] "COM1"
[1] "COM12"
error, disabling serialEvent() for //./COM12
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at processing.serial.Serial.serialEvent(Serial.java:287)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
Caused by: java.lang.NullPointerException
at processing.core.PApplet.append(PApplet.java:7966)
at sketch_130301a.serialEvent(sketch_130301a.java:751)
... 8 more
Exception in thread "Thread-3" java.lang.NullPointerException
at processing.serial.Serial.serialEvent(Serial.java:273)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
Please help me out. I have been stuck here for a long time.
Thanks in advance.
A null pointer exception occurs when java can't find an index in an array at that address. Are you sure that your serial ports are valid? Have you tested serial communication using another sketch in processing?

Resources