I'm trying to migrate to Java 17 from Java 8 over X2Go client
and when I try to run a simple code that includes GUI, even dialog with 1 button,
this exception is thrown:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "sun.awt.X11.XBaseWindow.isVisible()" because "parent" is null
at java.desktop/sun.awt.X11.XWindowPeer.setToplevelTransientFor(XWindowPeer.java:1688)
at java.desktop/sun.awt.X11.XWindowPeer.postInit(XWindowPeer.java:253)
at java.desktop/sun.awt.X11.XDecoratedPeer.postInit(XDecoratedPeer.java:105)
at java.desktop/sun.awt.X11.XBaseWindow.init(XBaseWindow.java:184)
at java.desktop/sun.awt.X11.XBaseWindow.<init>(XBaseWindow.java:259)
at java.desktop/sun.awt.X11.XWindow.<init>(XWindow.java:147)
at java.desktop/sun.awt.X11.XComponentPeer.<init>(XComponentPeer.java:111)
at java.desktop/sun.awt.X11.XCanvasPeer.<init>(XCanvasPeer.java:42)
at java.desktop/sun.awt.X11.XPanelPeer.<init>(XPanelPeer.java:48)
at java.desktop/sun.awt.X11.XWindowPeer.<init>(XWindowPeer.java:134)
at java.desktop/sun.awt.X11.XDecoratedPeer.<init>(XDecoratedPeer.java:62)
at java.desktop/sun.awt.X11.XDialogPeer.<init>(XDialogPeer.java:40)
at java.desktop/sun.awt.X11.XToolkit.createDialog(XToolkit.java:1084)
at java.desktop/java.awt.Dialog.addNotify(Dialog.java:768)
at java.desktop/java.awt.Window.pack(Window.java:829)
I had no such problems in Java 8 and I couldn't find any hint that could solve this.
It doesn't occur when running in KDE mode only when the session is in single application mode.
The OP is centOS 7.8.
Thanks in advance.
Related
I am trying to get Cassandra v2.1.17 running using Java 11 (Oracle), but cannot get it to startup. I have updated all the JVM args in cassandra-env.sh to the Java 11 equivalents, but I now get the following error on startup:
ERROR 14:48:10 Exception encountered during startup
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-16.0.jar:na]
...
...
...
Caused by: java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorEnter(Ljava/lang/Object;)V
I have done a good bit of looking about and it seems that this class was removed in Java 9, or at least deprecated, but was still accessible using --add-modules=jdk.unsupported. Adding this to my JVM args didn't help.
Is it possible to run Cassandra 2.1.17 on Oracle Java 11? I can see that the class is still in OpenJDK 11 (https://hg.openjdk.java.net/jdk/jdk11/file/6889f13694c6/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java) but I am stuck using Centos6 and cannot find an install for it.
#MeanwhileInHell, JDK 11 support for Apache Cassandra(R) was explored in the recent Cassandra 4.0 version only and I don't think it's available in very older and unsupported versions like 2.x. Please see https://cassandra.apache.org/doc/latest/cassandra/new/java11.html documentation for additional details.
https://issues.apache.org/jira/browse/CASSANDRA-9608 has details.
I am trying to simulate my existing project on ios via robovm. The java project starts running, but quickly encounters a problem with Netty (4.0.25) libraries that I am using. I am using the latest version of RoboVM.
Here is the error:
java.lang.ExceptionInInitializerError
at io.netty.util.internal.TypeParameterMatcher.get(TypeParameterMatcher.java:40)
at io.netty.util.internal.TypeParameterMatcher.find(TypeParameterMatcher.java:78)
at io.netty.channel.SimpleChannelInboundHandler.<init>(SimpleChannelInboundHandler.java:67)
at io.netty.channel.SimpleChannelInboundHandler.<init>(SimpleChannelInboundHandler.java:57)
at com.MyGame.MyThread.<init>(MyThread.java:22)
at com.MyGame.MyGame.create(MyGame.java:50)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java:301)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java:202)
at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.$cb$drawRect$(IOSGraphics.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:395)
at com.MyGame.IOSLauncher.main(IOSLauncher.java:18)
Caused by: java.lang.NullPointerException
at java.util.logging.Logger.log(Logger.java:1035)
at io.netty.util.internal.logging.JdkLogger.log(JdkLogger.java:606)
at io.netty.util.internal.logging.JdkLogger.info(JdkLogger.java:291)
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:91)
... 13 more
Here is the line pointed to in Netty:
} else if (PlatformDependent.hasJavassist()) {
It seems to me that Netty is trying use code that is unavailable in RoboVM. This application runs fine in Android or Desktop versions, and the RoboVM version seems to run if I remove Netty references. Any help on how to make the two coexist greatly appreciated.
I'm currently using Netbeans on Windows 7, and I'm trying to run the the xbee-api's OpenCloseConnection test but keep getting connection still open errors.
I use XCTU to make sure I'm in API mode and I've updated the variable "device" to be the COM that the xbee is on...
What are some leads? Below is the exception:
Exception in thread "main" com.rapplogic.xbee.api.XBeeException at
com.rapplogic.xbee.api.XBee.open(XBee.java:146) at
VFART.Main.main(Main.java:82) Caused by: gnu.io.PortInUseException:
Unknown Application at
gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at
com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:97)
at
com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:61)
at com.rapplogic.xbee.api.XBee.open(XBee.java:140)
We are trying to run a process (broker) from a SUSE Linux Enterprise Server 11 (java-1_7_0-ibm) which connects to a Javaspace Blackboard (JINI) deployed on another linux machine. (CentOs with Open JDK "1.7.0_05-icedtea" version)
Stack Trace :
INFO: Starting broker
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:259)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:653)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy0.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at edu.vt.ndssl.blackboard.JiniSpaceService.findSpace(JiniSpaceService.java:372)
at edu.vt.ndssl.blackboard.JiniSpaceService.<init>(JiniSpaceService.java:74)
at edu.vt.ndssl.blackboard.JavaSpaceBlackboard.<init>(JavaSpaceBlackboard.java:31)
at edu.vt.ndssl.blackboard.BlackboardFactory.make(BlackboardFactory.java:28)
at edu.vt.ndssl.broker.Broker.<init>(Broker.java:53)
at edu.vt.ndssl.broker.Broker.main(Broker.java:231)
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:237)
... 10 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1387)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2059)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1984)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1867)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1419)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:420)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 13 more
Same code works fine with Java 1.6 version upto 26.
I am looking for a correct version of Java to be installed on the SUSE Linux Enterprise Server which will be compatible with this OS and also equivalent to the Oracle JDK Update 5 or Open JDK Version 1.7.0_05 (icedtea).
Apparently, the root cause of the problem is that Oracle has made an incompatible change to the serialization format of the com.sun.jini.logging.Levels class. The change reportedly happened in Oracle JDK 1.6.0_38 and JDK 1.7.0_13, and has presumably made it into recent OpenJDK versions as well.
This problem has manifested in a variety of projects that use JINI. Examples:
https://issues.apache.org/jira/browse/RIVER-415 + https://issues.apache.org/jira/browse/RIVER-416.
https://cloudifysource.zendesk.com/entries/23079726-bootstrap-localcloud-not-working-Could-not-initialize-class-com-sun-jini-logging-Levels
More examples can be found by searching for "com.sun.jini.logging.Levels EOFException".
I can't say what the solution is / would be for you, but I have a couple of ideas:
Avoidance: I think you can avoid the problem if you don't mix pre and post-change JVM versions in your application network.
If you need to upgrade your application JVMs, I suggest that you upgrade them all, and then do a complete shutdown/restart of your JINI applications and services.
Fix your applications: It appears that the Apache River project fixed the problem by modifying the JINI code. As the issue ticket says:
The com.sun.jini.logging.Levels class produces a RuntimeException with the latest version of Java (both 1.6 and 1.7). The issue surrounds creation of custom java.util.logging.Level. The current implementation uses a ClassReplacingObjectOutputStream and the LevelData approach. By removing this approach and creating a subclass of java.util.logging.Level the issue gets resolved.
The issue ticket has a lot of discussion on the best way to do this, proposed patches and links to the checkin where they actually implemented the fix.
I wanted to start Hub and node using selenium-server standalone jar. Command used are right. I m able to start hub and rc nodes on 3 machines. Whereas in 4th machine, i used the same jar with the same commands.Its throwing, I'm getting following error
org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
at org.openqa.grid.common.RegistrationRequest.getRemoteControlConfiguration(RegistrationRequest.java:552)
at org.openqa.grid.internal.utils.SelfRegisteringRemote.startRemoteServer(SelfRegisteringRemote.java:85)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:72)
Thanks in advance..
The isEmpty() method was introduced in java 6. If you are using a version of java that is older, then perhaps thats where the error is coming from.