Initializer Error Using Netty 4 with RoboVM - java

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.

Related

Running Cassandra 2.1.17 on Java 11

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.

Unable to Connect to PowerDesigner through java

I have a requirement to automate the process of connecting to PowerDesigner through java to extract the models from repository. I have used the OLE Automation JavaProxy document to configure the process.
when trying to run, I'm getting this error:
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.swt.internal.ole.win32.COM.CoCreateInstance(Lorg/eclipse/swt/internal/ole/win32/GUID;IILorg/eclipse/swt/internal/ole/win32/GUID;[I)I
at
com.sybase.stf.powerdesigner.PdCommon.Application.start(Application.java:57)
at
com.sybase.stf.powerdesigner.PdCommon.Application.(Application.java:31)
at
com.sybase.stf.powerdesigner.PdCommon.Application.getInstance(Application.java:42)
at OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:37)
at OOM.src.createOOM.CreateOOM.main(CreateOOM.java:28)
Versions:
PowerDesigner - 16.5.5.0
Eclipse 4.18
Supporting Jars:
pdj2com_16.5.5.jar
org.eclipse.swt.win32.win32.x86_64_3.115.100.v20201202-1103.jar
The above issue is resolved Thanks!
Now i'm facing trouble connecting again with the below issue.
org.eclipse.swt.SWTException: Action can not be performed. result = -2137456383 (com.sybase.stf.powerdesigner.com.COMException: COM Failure [HRESULT: 0x80990101])
at org.eclipse.swt.ole.win32.OLE.error(OLE.java:345)
at com.sybase.stf.powerdesigner.com.COMException.raiseOnFail(COMException.java:83)
at com.sybase.stf.powerdesigner.com.IDispatchEx.raisingInvoke(IDispatchEx.java:231)
at com.sybase.stf.powerdesigner.PdCommon.IApplication.CreateModel(IApplication.java:84)
at OOM.src.createOOM.CreateOOM.createOOM(CreateOOM.java:68)
at OOM.src.createOOM.CreateOOM.CreateAndDisplayOOM(CreateOOM.java:42)
at OOM.src.createOOM.CreateOOM.main(CreateOOM.java:28)
Caused by: com.sybase.stf.powerdesigner.com.COMException: COM Failure [HRESULT: 0x80990101]
at com.sybase.stf.powerdesigner.com.COMException.raiseOnFail(COMException.java:88)
... 5 more
Is there anything else to add to the code to connect?
I am not able to find any solution online. Kindly help me figure this out. Thanks in advance.
The swt.win.win32.x86_64 jar is for 64-bit, so I assume you're using a 64-bit Java.
In my case, the pdj2com jar is named something like pdj2com_16.N.Nx64.jar for the 64-bit version. pdj2com_16.N.N.jar is the name of the 32-bit version.

java.lang.NoClassDefFoundError due to Native library issue?

I am trying to use timezone finding service (https://github.com/dustin-johnson/timezonemap) in my Flink java job.
It worked fine in local machine and it worked fine initially in Flink server, but after 2-3 restart of the job it started giving NoClassDefFoundError error-
java.lang.NoClassDefFoundError: Could not initialize class com.github.luben.zstd.ZstdInputStream
at org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream.<init>(ZstdCompressorInputStream.java:43)
at us.dustinj.timezonemap.data.DataLocator.getDataInputStream(DataLocator.java:22)
at us.dustinj.timezonemap.TimeZoneMap.forRegion(TimeZoneMap.java:92)
at us.dustinj.timezonemap.TimeZoneMap.forEverywhere(TimeZoneMap.java:60)
at dtap.service.TimezoneService.<init>(TimezoneService.java:17)
at functions.processors.KernelIntgrationProcessor.processElement(KernelIntgrationProcessor.java:47)
at functions.processors.KernelIntgrationProcessor.processElement(KernelIntgrationProcessor.java:23)
at org.apache.flink.streaming.api.operators.ProcessOperator.processElement(ProcessOperator.java:66)
at org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInput(StreamInputProcessor.java:202)
at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneInputStreamTask.java:105)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:704)
at java.lang.Thread.run(Thread.java:748)
When I looked at the code of ZstdCompressorInputStream class, it is loading native libraries.
And I found from below page that native library unloading issue could be the reason for this.
https://www.ibm.com/support/knowledgecenter/SS7K4U_8.5.5/com.ibm.websphere.zseries.doc/ae/rtrb_classload_viewer.html
Does anyone has faced similar issue or has idea to solve this problem?
Thanks
Mahendra

can't run 3D scripts in Processing (Java / openGL-related?)

I have been running to the same problem in all versions of Processing (visual design software) that I have been using, namely I get a java / openGL-related error, when I try to run 3D scripts. More specifically, I am getting the following message:
java.lang.NoSuchMethodError: javax.media.opengl.GLDrawableFactory.initSingleton()V
at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1652)
at javax.media.opengl.GLProfile.access$000(GLProfile.java:77)
at javax.media.opengl.GLProfile$1.run(GLProfile.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:128)
at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:2149)
at javax.media.opengl.GLProfile.get(GLProfile.java:898)
at javax.media.opengl.GLProfile.getGL2ES1(GLProfile.java:789)
at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6310)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Thread.java:745)
Could not run the sketch (Target VM failed to initialize).
I have already looked online, but I was not able to find an answer that would give me some solution. I am using a MacBook Pro with OS X 10 (Yosemite) and I am running Processing 2.2.1. Any help would be really welcome.
Austin is right, look at this answer: https://stackoverflow.com/a/19838327/458157
OS X 10 still comes with an obsolete version of Java 3D installed by default and it brings an obsolete version of JOGL which is loaded in priority. This old version has no method called javax.media.opengl.GLDrawableFactory.initSingleton(). you can find more information about this concern in my tutorial: http://tinyurl.com/qyf995p

Oracle JDK Update 5 (1.7.0_05) not working on SUSE Linux Enterprise Server 11. EOFException while connecting to Javaspace Blackboard (JINI)

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.

Categories