JavaFX Text throws Exception when binding textProperty is updated too often - data-binding

I have a JavaFX Text whose textProperty is bound to a String in a separate thread that represents a time for a countdown timer that is throwing an error. It never throws this error when the textProperty is only changed once per second but when it starts updating every 1/100 second it will work for a few seconds and then I get this error:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.scene.Scene$ScenePulseListener.synchronizeSceneNodes(Unknown Source)
at javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
at com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I came across this topic, JavaFX append text to TextArea throws Exception, which seems to have a similar problem. Is it because I am updating the Text too often and if so is there a better way do this? Thanks

Related

Java exception when running Change Assistant

I'm trying to use Change Assistant to apply a patching from tools 8.51 to 8.51.19 (yes I know that's ancient). I installed PeopleTools 8.51 and then installed PeopleTools 8.51.19 over the top of it. Then I installed Change Assistant and configured it to Perform PeopleTools Only Upgrade in the Tools > Options menu. Then I went to File > Import Template to import my upgrade template. Then I went to File > New Environment and created my environment (the test connection succeeded). But when I go to File > New Job and select my template and environment and Type of Upgrade = Initial Upgrade, I get this error
com.peoplesoft.pt.changeassistant.logging.Logger handleException
WARNING: Exception java.lang.NumberFormatException caught
in sun.misc.FloatingDecimal.readJavaFormatString()
empty String java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.valueOf(Unknown Source)
at com.peoplesoft.pt.changeassistant.Job.initStatus(Job.java:714)
at com.peoplesoft.pt.changeassistant.Job. (Job.java:199)
at com.peoplesoft.pt.changeassistant.client.main.frmMain$13.actionPerformed(frmMain.java:4261)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I don't have an older version of Change Assistant available to look at, but I think you want to actually "Apply a PeopleTools Patch" if going from 8.51.xx to 8.51.19. I don't recall if that is called out separately in the older CA versions, but those are two different options in the latest versions and I think has been like that for a while. The "Perform PeopleTools Only Upgrade", or "Upgrade PeopleTools", would usually mean going from something like 8.51 to 8.55.

JavaFX desktop app won't start in a specific machine (works in others)

I have a java desktop app using Swing which I rewrote in JavaFX using SceneBuilder.
The Swing app works fine on all users machines (35 Machine). After rewriting the app in JavaFX, on one specific machine the app won't start and gives the below error message.
I couldn't figure out the issue. I appreciate if someone can give any help.
Thank you.
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/PaintConverter
at com.jfoenix.controls.JFXPasswordField$StyleableProperties.<clinit>(JFXPasswordField.java:205)
at com.jfoenix.controls.JFXPasswordField.<init>(JFXPasswordField.java:156)
at idehmis.controller.LoginController.<init>(LoginController.java:51)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$Element.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at idehmis.IDEHMIS.start(IDEHMIS.java:30)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
it looks like the JVM is finding it difficult to locate the com.sun.javafx.css.converters.PaintConverter at runtimewhich causes the ClassNotFoundException Exception error, and which in turn causes the JFoenix library to throw java.lang.NoClassDefFoundError meaning the class was not found on the classpath. This indicates that we were trying to load the class definition, and the class did not exist on the classpath
so first make sure you have the right version of java which is Java 8 to support JFoenix, them make sure The JFoenix library is located in you classpath.
The stack trace, because it prefaces each fully-qualified class name (for example java.lang.ClassLoader) with a module name (e.g. java.base) indicates that the machine is trying to run the application using Java 9.
The CSS converter classes, such as PaintConverter, were promoted from private API, where they were located in Java 8 and earlier, to public API in Java 9. So the class com.sun.javafx.css.converters.PaintConverter no longer exists, and has been replaced by javafx.css.converter.PaintConverter. Hence, when running your application in Java 9, you get a ClassNotFoundException.
The bottom line here is that using any API that is not public, or using third party libraries that do so, is liable to make your application fail if the user updates their JVM. The possible solutions to this problem are:
Avoid using private API, or libraries that use private API
Create and maintain different versions of your code that are for specific JVM versions. In the case of the third-party JFoenix library you are using, there is a separate version for Java 9, so you could create a Java 9 version of the application that uses that version of the library. Note that not only does this create an additional burden on the developer, but it also can potentially create issues for the end user, who will be forced to update the version of your application they use in sync with updating their JVM.
Create a "Self-Contained Application Bundle" for your application. This bundles a specific JVM with your code, so you essentially control the JVM the user uses to run your application. The downsides to this are that you need to create a different bundle for each platform (Windows 32 bit, Windows 64 bit, Mac, Linux) that you want to support, and that the size of the application will increase substantially (to include the JVM).
I would generally recommend the first option when possible, and the third when not.

double click jar file

I have created a swing program that displays a gui and takes user data from the respective gui. The program works fine when I am running it from eclipse. But the problem is that when I make an executable jar file and double click it nothing happens. Even if I run the jar file from console nothing happens and exception occurs. I am using scheduler and for that I am using a quartz.jar file. I guess the problem is not there.
The exceptions are shown below...
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/quartz/Job
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.quartz.Job
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
I have added the main class in manifest.mf file, but no success.
Can anybody help me?
Here you go: File -> Export -> Java - JAR file, on the next screen check "Export java source files and resources"
or
read this link for command line executable jar conversion
http://www.mkyong.com/java/how-to-make-an-executable-jar-file/
or
if u want to convert windows exe use this tool Launch4J [http://sourceforge.net/projects/launch4j/]
Check your manifest.mf
after
Main-Class: YourClassHere
should be end with a new line or carriage return
Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

Jar file giving exception [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
i have created jar file that run successfully on cmd like this:
start javaw -Xmx1024m -jar JavaEdit.jar
My application is running by double click but when i perform a button click it gives exception which is not happening when i am running it via CMD.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Editor.compileIt(Editor.java:2407)
at Editor.CompileBtnActionPerformed(Editor.java:1412)
at Editor.access$300(Editor.java:113)
at Editor$7.actionPerformed(Editor.java:580)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Why it happen, please help... Thanks
at line No 2407 in source code:
StandardJavaFileManager fileManager = compiler.getStandardFileManager(c,
Locale.ENGLISH,
null);
The only possible place for a NullPointerException is this line:
StandardJavaFileManager fileManager = compiler.getStandardFileManager(c,
where the compiler is null. You should add println(System.getPropert("java.home")) statement to see which JRE/JDK is running the application.
My guess is that your JAVA_HOME is pointing to JDK and is in the PATH, but Windows is using JRE, as per ".jar" file association.
UPDATE:
You can run it with a runapp.bat file like this one:
%JAVA_HOME%\javaw.exe -Xmx1024m -jar JavaEdit.jar
The BAT file must be in the same folder as your JAR file.
UPDATE2:
Make sure you have defined the JAVA_HOME environment variable. You check with this command:
c:\> echo %JAVA_HOME%
It should print out the location of your JDK - C:\Program Files(x86)....
If you're getting a null JavaCompiler (or an NPE getting it), then I'm guessing you run your application with a JRE and not a JDK.
From the JavaDoc
Returns: the compiler provided with this platform or null if no compiler is provided

Error in invoking new browser session in Grid2-Selenium RC

I am trying to implement Grid2 using Selenium RC.
A able to invoke 1IE and 2FF browsers, but found the test case execution in one browser throws an error as below:
com.thoughtworks.selenium.SeleniumException: ERROR Server Exception:
sessionId should not be null; has this session been started yet?at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:101)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:95)
at com.thoughtworks.selenium.DefaultSelenium.mouseOver(DefaultSelenium.java:243)
at Framework.GlobalFunctions.mouseOver(GlobalFunctions.java:1233)
at EmployeeHealth.ProductVariables.EmployeeHealth.SelectSubMenuFromTab(EmployeeHealth.java:109)
at EmployeeHealth.TestScripts.EmployeeHealthRegressionSuite.EdCurrnUtilizModuleSelect(EmployeeHealthRegressionSuite.java:23725)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:691)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:883)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1208)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:758)
at org.testng.TestRunner.run(TestRunner.java:613)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:165)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Appreciate your help.
It looks like your client is sending a session ID that doesn't exist on the grid. Did the session timeout? Take a look at the grid console to see what it thinks is executing.

Resources