I am trying to use jobrunr with java 17. However, I am getting Unsupported class file major version 61 error while doing the same with the line
JobId jobId = BackgroundJob.schedule(runAt, () -> helper.excuteTaskAction();
Does jobrunr not support java 17? If it does can anyone help me figure out why a conflict is arising here? I am using the package jobrunr-spring-boot-starter:5.3.1.
I tried downgrading to java 8, which scheduled jobs without errors. However, I would very much like to keep working with java 17. Can somebody please help me with this?
Related
Tried to follow the answers to other similar questions here, unfortunately, to no avail. We are upgrading our application from JAVA 7 to JAVA 17. The code compiles just fine, the problem is when we try to run the .war file on apache-tomee-plume-8.0.8.
JAVA_HOME is set properly:
JAVA_HOME
As well as path:
PATH
Here is the log error message:
Caused by: java.lang.RuntimeException: Unable to read class definition for com.ui.AccountListLight$SubListDataModel
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1180)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:153)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java:166)
at org.apache.openejb.config.FinderFactory$OpenEJBAnnotationFinder.<init>(FinderFactory.java:546)
at org.apache.openejb.config.FinderFactory.newFinder(FinderFactory.java:267)
at org.apache.openejb.config.FinderFactory.create(FinderFactory.java:80)
at org.apache.openejb.config.FinderFactory.createFinder(FinderFactory.java:69)
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoader.java:878)
... 46 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:189)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:170)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:156)
at org.apache.xbean.asm9.ClassReader.<init>(ClassReader.java:277)
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinder.java:1176)
Yes, I understand that the issue is that I compiled on JAVA 17 and somehow TomEE is trying to run it on an older version (probably JAVA 7 as that was what I had installed before), but considering I removed all JRE/JDK stuff for JAVA 7 on my machine and all there is in it is JAVA 17, how does it keep happening? Thank you for your time.
The problem has nothing to do with Java being unable to read your Java 17-compiled classes. Looking at the stack trace, the problem is that org.apache.xbean.asm9.ClassReader is unable to read your class file. This particular ClassReader is one that TomEE uses to load your application. It is not surprising that TomEE can't read Java 17 applications, since the last release was in August, before Java 17 came out. It was itself compiled using an older version of Java. Hopefully a future version of TomEE will fix this issue.
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'm working with a piece of code that's quite old. It works absolutely fine with the versions of Java older than 8u161.
This is the error I get on 8u161 and beyond releases.
[main] ******** - Failed to create JmxConnectInfo!
java.lang.AbstractMethodError
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:150)
at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:135)
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:405)
This error is triggered from a class that extends javax.management.remote.rmi.RMIConnectorServer where I invoke the code
super.start()
I'm sure that this error is caused by JDK-8159377 but I'm unable to figure a way out!
Can someone pls advise?
I have trouble with using XLConnect library. I am getting an error for the below code:
library(XLConnect)
wb<-loadWorkbook("name.xlsx", create = NULL)
And the related error is:
Error: IllegalArgumentException (Java):
I cant solve this problem. I searched a lot of topics. However, I couldn't manage to solve.
I use RStudio as gui. The version are as below:
R : [64-bit] C:\Program Files\R\R-3.2.5
RStudio : Version 1.0.136
Java : Version 8 Update 121 (build 1.8.0_121-b13)
Windows : Microsoft Windows 10 Pro
I will be very glad for any help or suggestion.
Thanks a lot.
I am using JavaGuard to obfuscate one of my .jar files and got this error:
# ERROR - corrupt class file: me/project/main/Main.class java.io.IOException: Incompatible version number for class file
format: 52 / 0 at
net.sf.javaguard.classfile.ClassFile.read(ClassFile.java:160) at
net.sf.javaguard.classfile.ClassFile.create(ClassFile.java:116) at
net.sf.javaguard.GuardDB.addClasses(GuardDB.java:415) at
net.sf.javaguard.GuardDB.startObfuscate(GuardDB.java:274) at
net.sf.javaguard.GuardDB.obfuscate(GuardDB.java:243) at
JavaGuard.obfuscate(JavaGuard.java:322) at
JavaGuard.start(JavaGuard.java:179) at
JavaGuard.main(JavaGuard.java:146)
What can I do to fix this? My code compiles fine and the .jar export has no errors. I have no problems with my code or .java files.
It looks like you are compiling your code using Java 8, then using a version of javaguard that does not understand Java 8 class formats. The format: 52 in the exception message is the class format version, indicating Java 8. This Wikipedia entry lists the possible values and the corresponding Java versions https://en.wikipedia.org/wiki/Java_class_file
This is hardly surprising - the last javaguard release appears to be a 1.0 beta in 2002. You may need to use another tool
For the "//INTERNAL ERROR//" thing you can use Luyten decompiler; It'll get your code.
For the "# ERROR - corrupt class file: me/project/main/Main.class java.io.IOException: Incompatible version number for class file format: 52 / 0 at" error, you may want to use a newer version of proguard.
I had this problem (using proguard maven plugin) and got it resolved using the 5.3.2.