Run JavaFX Application in Raspberry Pi - javafx

I have created a JavaFx application. Now i want to run this application in Raspberry Pi. But while i am trying to run it is not responding and giving me the following error.
Raspberry Pi Information
pi#raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
While i am trying to run my application the following error occurred
cannot open display
cannot create resource
Error details while running from terminal
Exception in Application start method
Exception in thread "main" 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 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$152(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.awt.AWTError: Can't connect to X11 window server using 'localhost:0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at java.awt.Window.initGC(Window.java:475)
at java.awt.Window.init(Window.java:495)
at java.awt.Window.<init>(Window.java:537)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:189)
at com.qps.swing.frame.FirstScene.<init>(FirstScene.java:33)
at qps_swing.QPS_Swing.start(QPS_Swing.java:20)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
... 1 more
Error Details while running from Netbeans IDE
ant -f /home/pi/NetBeansProjects/Test jfxsa-run
init:
deps-clean:
Updating property file: /home/pi/NetBeansProjects/Test/build/built-clean.properties
Deleting directory /home/pi/NetBeansProjects/Test/build
clean:
init:
deps-jar:
Created dir: /home/pi/NetBeansProjects/Test/build
Updating property file: /home/pi/NetBeansProjects/Test/build/built-jar.properties
Created dir: /home/pi/NetBeansProjects/Test/build/classes
Created dir: /home/pi/NetBeansProjects/Test/build/empty
Created dir: /home/pi/NetBeansProjects/Test/build/generated-sources/ap-source-output
Compiling 1 source file to /home/pi/NetBeansProjects/Test/build/classes
compile:
Created dir: /home/pi/NetBeansProjects/Test/dist
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from /opt/jdk1.8.0_151/jre/../lib/ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from /opt/jdk1.8.0_151/jre/../lib/ant-javafx.jar
Internal error. Missing resources [/resources/web-files/javafx-loading-100x100.gif]
/home/pi/NetBeansProjects/Test/nbproject/jfx-impl.xml:1487: The following error occurred while executing this line:
/home/pi/NetBeansProjects/Test/nbproject/jfx-impl.xml:3134: The following error occurred while executing this line:
/home/pi/NetBeansProjects/Test/nbproject/jfx-impl.xml:2096: Error: -includedt requires the java deployment toolkit, which is not included in this distribution
BUILD FAILED (total time: 18 seconds)

Related

How to config throttling in wso2 4.0.0 active-active deployment pattern

I follow this doc
to configure an Active-Active API-M Deployment, but it fails when run command api-manager.sh.
[root#localhost bin]# ./api-manager.sh
JAVA_HOME environment variable is set to /usr/java/jdk1.8.0_191
CARBON_HOME environment variable is set to /home/wso2/wso2am-4.0.0
Using Java memory options: -Xms256m -Xmx1024m
[2022-03-13 10:55:04,145] SEVERE {org.wso2.carbon.server.Main handleConfiguration} - Error
while perfo
rming configuration changes org.wso2.config.mapper.ConfigParserException: Error while reading
metadata
at org.wso2.config.mapper.MetaDataParser.readLastModifiedValue(MetaDataParser.java:76)
at org.wso2.config.mapper.MetaDataParser.getChangedFiles(MetaDataParser.java:164)
at org.wso2.config.mapper.ConfigParser.parse(ConfigParser.java:108)
at org.wso2.carbon.server.Main.handleConfiguration(Main.java:236)
at org.wso2.carbon.server.Main.main(Main.java:107)
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 org.wso2.carbon.bootstrap.Bootstrap.loadClass(Bootstrap.java:69)
at org.wso2.carbon.bootstrap.Bootstrap.main(Bootstrap.java:51)
Caused by: java.io.FileNotFoundException: /home/wso2/wso2am-
4.0.0/repository/deployment/server/eventpub
lishers/jmsEventPublisher2.xml (No such file or directory) at j
ava.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at org.wso2.config.mapper.MetaDataParser.getMetadata(MetaDataParser.java:97)
at org.wso2.config.mapper.MetaDataParser.readLastModifiedValue(MetaDataParser.java:74)
... 10 more
Do i miss anything?

Why is org.flywaydb.core.Flyway API not loading builtin mysql driver

I am trying to migrate with application startup using the Flyway programatic API, but it seems to fail to load mysql drivers.
I am using gradle everything works fine if I use command line (presummably because I can specify the driver), but I get the following error when application starts up:
Exception in thread "main" 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 org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: com.mysql.cj.jdbc.Driver => Check whether the jar file is present
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:141)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:107)
at org.flywaydb.core.api.configuration.ClassicConfiguration.setDataSource(ClassicConfiguration.java:1226)
at org.flywaydb.core.api.configuration.FluentConfiguration.dataSource(FluentConfiguration.java:741)
... 8 more
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class com.mysql.cj.jdbc.Driver : com.mysql.cj.jdbc.Driver
at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:63)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:137)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:61)
... 13 more
This seems to be a problem of the mysql connector. I downgraded to 6.0.+ and works fine.
compile ('mysql:mysql-connector-java:6.0.+')

Error in executing OWBClient.sh in UNIX

I am trying to run the OWBClient.sh with the command in UNIX and I am getting the following error:
" The JVM option is invalid: -XX: MaxPermSize=256M. Could not create the Java Virtual Machine."
OWB Version: 10.2.0.5
Oracle Database : 10g
UName: AIX
When exploring more on the above issue, I got an information that OWB 10.2 could not be run in AIX. It would be helpful if anyone can can shed some light on whether OWB 10.2.0.5 can be run on AIX?
Editing my post to share an update.I have tried to execute the owbclient.sh file by removing the -XX:MaxPermSize=256M part. I am now getting a different kind of error...
$ ./owbclient.sh
[Launcher]: Error! Cannot find and load the jar file '../../../jdk/jre/lib/ rt.jar'. OWB application may not be launched due to this error.
[Launcher]: Error! Cannot find and load the jar file '../../../jdk/jre/lib/ jce.jar'. OWB application may not be launched due to this error.
StaticLoader: Setting locale to en__
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at Launcher.main(Launcher.java:167)
Caused by: java.lang.InternalError: Can't connect to X11 window server using ':0 .0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:1 75)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi ronment.java:91)
at sun.awt.motif.MToolkit.(MToolkit.java:124)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at java.awt.Toolkit$2.run(Toolkit.java:796)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java:287 )
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:787)
at java.awt.Component.getToolkitImpl(Component.java:873)
at java.awt.Component.getToolkit(Component.java:857)
at java.awt.Component.createImage(Component.java:2729)
at oracle.wh.ui.common.CommonUtils.getIcon(CommonUtils.java:622)
at oracle.wh.ui.framework.beans.splash.SplashBean.setImageLoc(SplashBean .java:111)
at oracle.wh.ui.framework.beans.splash.SplashBean.(SplashBean.java :42)
at oracle.wh.ui.framework.StaticLoader.main(StaticLoader.java:67)
... 6 more
java.lang.reflect.InvocationTargetException
$

Oozie not starting in Amazon EMR

I tried to install Apache oozie in EMR cluster. I am getting the error. “Error: IO_ERROR : java.net.ConnectException: Connection refused”.
Followed the below link for installation:
http://pkavuri.blogspot.in/2013/08/oozie-installation-is-simplified.html
I got the error after running the below command:
bin/oozie admin -oozie http://localhost:11000/oozie -status
The following steps I did after encountering the error:
Moved the Hadoop and common jar files to the folders
“/oozie-3.3.2/distro/target/oozie-3.3.2-distro/oozie-3.3.2/oozie-server/webapps/oozie/WEB-INF/lib”
and “oozie-3.3.2/distro/target/oozie-3.3.2-distro/oozie-3.3.2/lib/”
Downloaded derby in oozie-3.3.2/libext
The error trace after running the command "tail -100f logs/catalina.out":
ERROR: Oozie could not be started
REASON: java.lang.NoClassDefFoundError:
org/apache/hadoop/util/ReflectionUtils
Stacktrace:
----------------------------------------------------------------- java.lang.NoClassDefFoundError: org/apache/hadoop/util/ReflectionUtils
at org.apache.oozie.service.Services.setServiceInternal(Services.java:359)
at org.apache.oozie.service.Services.(Services.java:108)
at org.apache.oozie.servlet.ServicesLoader.contextInitialized(ServicesLoader.java:38)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused
by: java.lang.ClassNotFoundException:
org.apache.hadoop.util.ReflectionUtils
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 27 more
Try creating a libext folder and put all hadoop jars , extjs jars in it . Then run oozie-setup.sh and then oozie-run.sh
In this case based on your logs i guess you are missing hadoop-core.jar.

Error in creating an Executable JAR

I have created a JAR File in the command prompt. While executing the JAR file using the command java -jar MyJAR.jar
I am getting the following error.
Exception in thread "main" java.lang.NoClassDefFoundError.
Caused by: java.lang.ClassNotFoundException: ShipmentData
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: ShipmentData . Program will exit.
Please help me to sort this issue.

Resources