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.
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 forked this apache solr and when I try to build as indicated in the README, I get the following errors:
When trying to install on java version 11
[root#192 solr]# ./gradlew assemble
Exception in thread "main" java.lang.IllegalArgumentException: error: release version 11 not supported
at jdk.compiler/com.sun.tools.javac.main.Arguments.reportDiag(Arguments.java:891)
at jdk.compiler/com.sun.tools.javac.main.Arguments.handleReleaseOptions(Arguments.java:311)
at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:350)
at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:246)
at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:185)
at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:119)
at jdk.compiler/com.sun.tools.javac.launcher.Main.compile(Main.java:364)
at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:176)
at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:119)
\nSomething went wrong. Make sure you're using Java 11 or later.
Then I decided to change the version to 1.8.0, having received the following:
[root#192 solr]# ./gradlew assemble
Unrecognized option: --source
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
\nSomething went wrong. Make sure you're using Java 11 or later.
Has anyone encountered the same problem, and if you managed to solve it, then how?
Our J2EE/Spring/Mybatis web application has been running fine for some time on Java 7 (on Centos), but recently we tried updating our JVM to Java 8, and now we get the following stack-trace on start up:
java.lang.RuntimeException: XPathFactory#newInstance()
failed to create an XPathFactory for the default object model:
http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException:
java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory:jar:file:/usr/local/tomcats
/test/webapps/tms/WEB-INF/lib/saxon-xpath-8.7.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102)
at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:261)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:121)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:75)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:70)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.loadXmlResource(MapperAnnotationBuilder.java:158)
at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:113)
at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:66)
at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:651)
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:97)
our Saxon9.jar version = 9.1.0.8 (latest).
There are many different jars/dependencies involved in parsing xml/xslt in our application, and I don't want to try guessing what changes to make by trial and error. Does anyone know what could be causing this, or where to look first?
This problem is described here.
If you want to use Saxon with Java 8 you need to upgrade Saxon to a version >= 9.5.1.5
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'm getting this error when starting the JBoss server in Eclipse.
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed.
DEPLOYMENTS IN ERROR
Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: wrong arguments. new for taget java.land.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
I've googled the AttachementStore error and most suggested modifying the profile.xml (conf/bootstrap/profile.xml) file by adding a class to the constructor parameter node like this...
constructor parameter class="java.io.File"
Adding the class="java.io.File" seems to be the accepted solution everywhere since it's a known bug in JBoss but it didn't work for me.
I know I added the class correctly, I checked, rechecked and rechecked again the profile.xml file but JBoss is still throwing the same error when starting. I'm completely baffled. Anyone have any other ideas?
Error mainly occurred due to upgrade java 6 to java 7 or 8. Previously I used jdk 6u10 and it is changed to jdk 7u45.
Run the projects using java release of jdk 6u10 or Sun JDK 1.6.0_13. JBOSS runs with these JDK version successfully.